matplotlib - pandas - No xlabel and xticks for twinx axes in subploted figures

后端 未结 2 485
孤城傲影
孤城傲影 2021-01-18 12:29

I had a similar question, which was answered previously. However, it differs in usage of Pandas package with it.

Here is my previous question: matplotlib - No xlabe

相关标签:
2条回答
  • 2021-01-18 13:01

    I just got the same issue because I was mixing plots made with matplotlib and made with Pandas.

    You should not plot with Pandas, here is how you could replace:

    pd.Series(range(10)).plot(ax=ax42)
    

    with

    ax42.plot(pd.Series(range(10))
    
    0 讨论(0)
  • 2021-01-18 13:15

    As Scimonster mentioned above for me it worked when I plotted all the pandas before creating twinx axes.

    I had few plots in twinx which were also coming from Pandas Dataframe objects (x,t plots). I created separate lists before starting the plot and then used them to plot after plotting the first pandas plots.

    to summarize my work flow was 1. Creating lists for twinx plots 2. opening plot and plotting all pandas plots with normal axes. 3. creating twinx axes 4. plotting lists on twinx axes

    fortunately, this flow is working for me

    0 讨论(0)
提交回复
热议问题