2016-11-22 8 views
-2

プロットされたデータポイントを接続したいと考えています。散布図の点をPythonでどのように接続すればよいですか?

plt.plot(us, mu, 'ro', us, ru, 'go') 
plt.show() 
+0

あなたのコードをあなたの質問に追加してください。 – amin

+2

'ro-'、 'go-'。 http://matplotlib.org/api/pyplot_api.html?highlight=plot#matplotlib.pyplot.plot – Bart

+0

[matplotlib:ライン上の個々の点のマーカを設定する]の可能な複製を参照してください(http://stackoverflow.com/questions/8409095/matplotlib-set-marker-for-a-line) – Bart

答えて

0

pyplot documentationによれば、これを試すことができます。

# adding dotted line between points 
plt.plot(us, mu, 'r:o', us, ru, 'g:o') 
plt.show() 
+0

'plot()'コマンドを2回呼び出す必要はありません。 Matplotlibは書式設定において非常に柔軟なので、 'ro:'と 'go:'で 'plot'()を呼び出すと同じ結果が得られます。 – Bart

+0

あなたのコメントありがとう、私はそれを適用しました。 – amin

関連する問題