ストリームラインプロットに開始点を追加しようとしています。私は開始点を使ってコード例を見つけましたhere;このリンクでは、別の問題が議論されますが、start_points引数が機能します。 hereから私は流線のサンプルコード(images_contours_and_fieldsサンプルコード:streamplot_demo_features.py)を取得しました。なぜ私は開始点をあるコードで定義し、他のコードでは定義できないのか分かりません。私は、サンプルコード(streamplot_demo_features.py)で開始ポイントを定義しようとすると、私は次のエラーを取得する:Python Matplotlib開始点を提供するStreamplot
Traceback (most recent call last):
File "<ipython-input-79-981cad64cff6>", line 1, in <module>
runfile('C:/Users/Admin/.spyder/StreamlineExample.py', wdir='C:/Users/Admin/.spyder')
File "C:\ProgramData\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/Admin/.spyder/StreamlineExample.py", line 28, in <module>
ax1.streamplot(X, Y, U, V,start_points=start_points)
File "C:\ProgramData\Anaconda2\lib\site-packages\matplotlib\__init__.py", line 1891, in inner
return func(ax, *args, **kwargs)
File "C:\ProgramData\Anaconda2\lib\site-packages\matplotlib\axes\_axes.py", line 4620, in streamplot
zorder=zorder)
File "C:\ProgramData\Anaconda2\lib\site-packages\matplotlib\streamplot.py", line 144, in streamplot
sp2[:, 0] += np.abs(x[0])
ValueError: non-broadcastable output operand with shape (1,) doesn't match the broadcast shape (100,)
私はstart_pointsを使用する方法で、ウェブ上くらいなので、任意の追加がないの通知をしました情報が役立つだろう。
スタックオーバーフローが愚かであると私は私のポストに次のリンクを追加できないだろう。http://matplotlib.org/devdocs/api/_as_gen /matplotlib.axes.Axes.streamplot.html。ここから私はstart_pointsに必要な入力を見ることができますが、その他の情報はあまりありません。 – JWil