1
私は以下のコードを持っていますが、同じグラフ上にあるが異なるサブプロットにしたい。異なる軸タイプの複数のプロットをプロットする
異なる軸を作成する最も簡単な方法は何ですか?
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()
恐ろしいが、ちょうどどのようなコマンドは、これらのサブプロットにラベルを付け、それぞれに特定のタイトルを与えることだ...おかげ –
を:私は(http://matplotlib.sourceforge.net/api/pyplot_api.html#pyplot参照)プログラミングのために推奨され
pyplot
APIを使用していますset_title()を使用します。私は例を更新しました。 – bmu