For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

plot size question



  • Hi!
    When I make a plot as in the following:

    num = 20
    fig = cerebro.plot(numfigs = num, barupfill = False, bardownfill = False, style = 'candle', plotdist = 0.5, 
                       figsize=(30,30), volume = False, barup = 'green', valuetags = False, subtxtsize = 7,
                       start = startdate, end = enddate)
    
    for i in range(num):
        fig[0][i].tight_layout()
        fig[0][i].savefig(output_folder + '/{}_'.format(timeframe) + stratname + '_{}'.format(strat_type) + '_plot{}.png'.format(i), dpi=300, hight = 30, width = 30, tight = True)
    

    I get one very nice big plot as can be seen here (it's the second image printed):
    0_1547319328385_30min_boll_macd_long_plot1.png

    and 19 small not so nice plots (where one can be seen here):
    0_1547319813967_30min_boll_macd_long_plot2.png

    What could be the reason ? Would love to see 20 plots similar to the first one.

    Thank you for your help!



  • @alain said in plot size question:

    figsize=(30,30)

    Hey @Alain, I was wondering how you got the plot to change size at all!? Which IDE are you using?

    Best,
    Nikitaj


  • administrators

    @alain said in plot size question:

    hight = 30
    

    Things are in the matplotlib arena, but that could have something to do with it.



  • Hi @nikitaj and @backtrader

    Actually the figsize = (30,30) command didn't do anything to the plots. I also deleted hight = 30, but nothing changed...
    I'm using anaconda -> spyder.

    The code now looks like this

    fig = cerebro.plot(numfigs = num,barupfill = False, bardownfill = False, style = 'candle', plotdist = 0.5, 
                       volume = False, barup = 'green', valuetags = False, subtxtsize = 7,
                       start = startdate, end = enddate)
    
    for i in range(num):
        fig[0][i].tight_layout()
        fig[0][i].savefig(output_folder + '/{}_'.format(timeframe) + stratname + '_{}'.format(strat_type) + '_plot{}.png'.format(i), dpi=500)
    

    and unfortunately I still get one nice plot and all others are small... no idea why.
    Should all plots look like the big one I posted ?

    Thanks,
    Alain


  • administrators

    @alain said in plot size question:

    I'm using anaconda -> spyder.

    Do it in the shell.



  • same result unfortunately... also updated matplotlib, de- and reinstalled anconda, but nothing helps so far.


Log in to reply
 

});