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 with logarithmic y axis
-
Is it possible to use logarithmic scale for y axis when plotting with cerebro?
-
Use
plotinfo=dict(plotlog=True)
and try your luck. -
@backtrader Thanks. I couldn't get it to work. I am not plotting individual datas but only cash, value, and trades profits/losses. I wasn't sure where to specify plotinfo=...
I tried in cerebro.plot(plotinfo=...) and cerebro.run(plotinfo=...) but y-scale was not logarhitmic. -
No,
plotinfo
is a property (which you declara as adict
, but which supports dot notation too) of lines objects like data feeds, indicators ...mydata = bt.feeds.MyPreferredDatafeed(dataname='xxx') mydata.plotinfo.plotlog = True
or
# not recognized kwargs will be passed to plotinfo mydata = bt.feeds.MyPreferredDatafeed(dataname='xxx', plotlog=True)
or
class MyOwnLog(bt.feeds.MyPreferredDatafeed): plotinfo(plotlog=True) mydata = bt.feeds.MyOwnLog(dataname='xxx')