条形图上的缩放问题

时间:2018-11-27 23:14:54

标签: python dataframe matplotlib plot graph

我正在尝试在同一张图表上绘制一些数据。我在图表的条形部分上缩放时遇到问题。图表上最大的条形图似乎最多只能显示-60k。我知道数据上的最大值接近-166k。我不确定条形数据我在做什么错。任何帮助将不胜感激!

enter image description here

我还注意到,当使图表窗口变大时,较大的条形图开始向更高方向爬行,并且没有保持按比例缩放。

enter image description here

这是我的代码: fig,ax = plt.subplots()

ax.bar(stats_df.index, stats_df['MaxDrawPerPeriod'])
axtwin = ax.twinx()
axtwin.plot(stats_df.index, stats_df['ClosedPL_Accum'])
ax.set_ylim(0,-160000)
# axtwin.set_ylim()
plt.show()

0 个答案:

没有答案