Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Need some help about the plotting and manipulating the figure

    General Code/Help
    2
    4
    874
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • eggachecat
      eggachecat last edited by eggachecat

      Hi thanks for the great job! And I have some questions about the plotting and the figure..

      Q-1

      I am wondering if I can adjust the height of the plotting figure
      Let say we have the figure
      0_1526527974683_quickstart101.png
      Is there a way to adjust the parts A B D E F G the same height as partC ?

      Q-2

      Besides, is there an easy way to get all the information of the plotted figure? Is there a way like

      cerebro.run()
      part_A=cerebro.get_part("A")
      data_A = part_A.get_ydata()
      

      where data_A is the data which cerebro used to plot the figure ?

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @eggachecat last edited by

        @eggachecat said in Some problems about the plotting and the figure:

        Is there a way to adjust the parts A B D E F G the same height as partC ?

        Yes and no, because you cannot have scrolling because it is matplotlib limited. For the heights of different rows see: Docs - Plotting. Although it is bound to break due to the impossibility of managing unlimited combinations.

        @eggachecat said in Some problems about the plotting and the figure:

        where data_A is the data which cerebro used to plot the figure ?

        A is an observer and held by the strategy. See Docs - Strategy


        And now: Where are the problems?

        1 Reply Last reply Reply Quote 1
        • eggachecat
          eggachecat last edited by eggachecat

          @backtrader Sorry, It should be questions not problems
          My bad..Can I change the title?

          And thanks for the response!!

          1 Reply Last reply Reply Quote 0
          • eggachecat
            eggachecat last edited by

            For those who just want the code

            Q-1

                cerebro.plot(rowsmajor=1, rowsminor=1)
            

            will do the trick.

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors