13.3|13.3 Plotting on the same axis

Example:

import backtrader as btcerebro = bt.Cerebro()data0 = bt.feeds.MyFavouriteDataFeed(dataname='futurename') cerebro.adddata(data0)data1 = bt.feeds.MyFavouriteDataFeed(dataname='spotname') data1.compensate(data0)# let the system know ops on data1 affect data0 data1.plotinfo.plotmaster = data0 data1.plotinfo.sameaxis = True cerebro.adddata(data1)...cerebro.run()

data1 gets some plotinfo values to:
  • 【13.3|13.3 Plotting on the same axis】Plot on the same space as plotmaster which is data0
  • Get the indication to use the sameaxis
The reason for this indication is that the platform cannot know in advance if the scales for each data will be compatible. That’s why it will plot them on independent scales

    推荐阅读