栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python-双坐标作图(加图例)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python-双坐标作图(加图例)

其实就是很简单的一个双坐标绘制,由于画了两条曲线,对应图列还是需要加的。

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)

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/461020.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号