【发布时间】:2019-08-06 05:18:04
【问题描述】:
da 是我的数据框。我想把这个数字变成我将拥有的 2 个子图中的一个子图。当我为这个图添加 plt.subplots(2,1,2) 时,它最终将该图分成一个单独的图,并且子图是一个空图。
我怎样才能把这段代码变成一个子图?
ax1 = da.plot(rot = 90, title ='Pre-Folsom Dam Spring Recession')
ax1.set_xlabel('Water Year Day')
ax1.axhline( y = float(fSP_Mag) , xmin=0, xmax=35,color ='r', linestyle='--',zorder=0,label= 'Magnitude')
ax1.axvline(x=float(fSP_Tim), color ='r',linestyle='--', label='Timing')
ax1.legend(framealpha=1, frameon=True)
【问题讨论】:
标签: python-3.x pandas matplotlib