首页
技术
登录
6mi
u
盘
搜
搜 索
技术
python:matplotlib 绘制两条y轴
python:matplotlib 绘制两条y轴
技术
2022-07-11
107
实例代码
x= np.arange(10) y1 = x**2 y2 = x**4 _,ax=plt.subplots() ax.plot(x,y1,'b') ax.set_xlabel('x') ax.set_ylabel('y1',color='b') ax2 = ax.twinx() ax2.plot(x,y2,'r') ax2.set_ylabel('y2',color='r')
结果
转载请注明原文地址:https://ipadbbs.8miu.com/read-11455.html
最新回复
(
0
)