其实就是很简单的一个双坐标绘制,由于画了两条曲线,对应图列还是需要加的。
data1=pd.read_csv('br.csv')
data2=pd.read_csv('bt.csv')
By=list(data1['Br []'])
Bx=list(data2['Bt []'])
fig = plt.figure(figsize=(10,6))
ax1=fig.add_subplot(111)
ax1.plot(By,label='Br')
ax1.set_ylabel('Br(T)')
ax2 = ax1.twinx()
ax2.plot(Bx,'r',label='Bn')
ax2.set_ylabel('Bn(T)')
ax1.legend(loc='upper left')
ax2.legend(loc='upper right')
fig.savefig('111',bbox_inches = 'tight',pad_inches = 0,dpi =350)