jupyter notebook上でpolyfitを使って近似曲線を描いていたら、以下のようなエラーが出てきてうまくいきません。
C:\Users\a3215\Anaconda3\lib\site-packages\ipykernel_launcher.py:12: RankWarning: Polyfit may be poorly conditioned
if sys.path[0] == '':
なお、同じグラフ内に複数個の近似曲線を描きたいのですが、最初の一個目の曲線はエラーなく描けるのですが、二つ目以降も同じようなコードで描こうとすると上記のメッセージが出ます。
何が問題なのかわからないため、質問させて頂きました。
以下が実行したコードです。
fig = plt.figure()
ax = fig.add_subplot(111)
plt.yscale('log')
plt.scatter(temp0, resi0, )
plt.scatter(temp02, resi02, )
plt.scatter(temp05, resi05, label='moise0.5')
plt.scatter(temp10, resi10, label='moise1.0')
func0 = np.poly1d(np.polyfit(temp0, resi0, 7))
plt.plot(temp0, func0(temp0), label='moise0')
func02 = np.poly1d(np.polyfit(temp02, resi02,7))
plt.plot(temp02, func02(temp02), label='moise02')
plt.legend(loc='best')
なお、未だにpythonは初心者なので、お手数ですがわかりやすく教えて頂けたらと思います。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/12 08:11