2016-10-12 8 views
1

同じグラフで2行を取得したいと思います。2つの異なるグラフをPythonでプロットする方法

これは私のコードです:

x=sorted(true_strain) 
    y=sorted(true_stress_1) 
    plt.plot(x,y) 
    plt.title('$Tensile Stress-Strain Curve$') 
    plt.xlabel('True Strain [-]') 
    plt.ylabel('$True Stress (MPa)$') 
    a=(true_stress_2) 
    b=sorted(true_strain) 
    plt.plot(a,b) 

しかし、私が得た画像は空白です。私は何が欠けていますか?

+2

あなたはどのライブラリを使用していますか?私はあなたが何を使用しているかを判断するためにここに何か輸入物や何かを見ません。 – nbering

+0

bはtrue_strain、aはtrue_stress_2としますか?あなたはxをtrue_strain、yをtrue_stressとしているので、プロットを投げる可能性のある独立変数と従属変数を入れ替えるように見えます。 –

答えて

0

あなたは実際にplt.show()を呼び出していません。下部に追加してみてください。

x=sorted(true_strain) 
y=sorted(true_stress_1) 
plt.plot(x,y) 
plt.title('$Tensile Stress-Strain Curve$') 
plt.xlabel('True Strain [-]') 
plt.ylabel('$True Stress (MPa)$') 
a=(true_stress_2) 
b=sorted(true_strain) 
plt.plot(a,b) 
plt.show() 
関連する問題