【发布时间】:2012-05-08 14:11:51
【问题描述】:
我有以下代码,但我希望它们在同一个图表上,但在不同的子图上。
创建不同轴的最简单方法是什么?
from pylab import *
figure(0)
x =1
y = 2
plot(x, y, marker ='^', linewidth=4.0)
xlabel('time (s)')
ylabel('cost ($)')
title('cost vs. time')
figure(1)
x = 4
y = 100
plot(x, y, marker ='^', linewidth=4.0)
xlabel('cost ($)')
ylabel('performance (miles/hr) ')
title('cost vs. time')
show()
【问题讨论】:
标签: python python-3.x matplotlib python-2.7