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

Date Axis does not show up on plot

  • Hi all.

    When I run cerebro.plot(), my plot does not contain an X-axis for date. However, when I put my mouse cursor over the matplotlib graph in jupyter notebook.

    Any advice on how to get the X date axis on the plot? Thanks!

    alt text

  • Afaik it's matplotlib issue, there are many of them with the newest version. I recommend downgrading to lower version (3.0.3 works perfectly for me).

  • @MrKalindro thanks. I was able to get it working with Matplotlib 3.2.2 by changing one line - line 264 - in Specifically, I added visible=True.

            259: # Applying fig.autofmt_xdate if the data axis is the last one
            260 # breaks the presentation of the date labels. why?
            261 # Applying the manual rotation with setp cures the problem
            262 # but the labels from all axis but the last have to be hidden
            263 for ax in laxis:
                264 self.mpyplot.setp(ax.get_xticklabels(), visible=True)

    I have another question. How can I set the frequency of the ticks in the x-axis (date axis)? I want to set the ticks to appear more frequently (ex: every 2 weeks, or every month) instead of once every 2 months.

    alt text

Log in to reply