- 积分
- 56367
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2016-10-20 17:28:45
|
显示全部楼层
给两个axes都加上xlim语句使其具有相同的x轴范围。
 - ax1 = axes()
- xaxis(ax1, color='k')
- yaxis(ax1, color='k')
- t = arange(1,11)
- #s1 = t**3
- #plot(t, s1, '-ro')
- s2 =[14,15,18,17,12,18,10,11,12,13]
- plot(t, s2, '-ro')
- xlim(0, 11)
- xlabel('station')
- ylabel('temperature', color='k')
- ax2 = twinx(ax1)
- yaxis(ax2, color='k')
- b=[10,15,18,20,50,8,20,30,16,40]
- bar(b,0.2,color='b')
- ylim(0,60)
- xlim(0,11)
- ylabel('rain', color='k')
- title('Two y axis example')
|
|