3.

線の種類

編集

これはMatplotlibのグラフの線の種類に関する記事です。

 

構文

plot(x, y, linestyle="線の種類")

線の種類は以下のものを指定できます。

'-' or 'solid'
'--' or 'dashed'
'-.' or 'dashdot'
':' or 'dotted'

 

import matplotlib.pyplot as plt

x = [1, 2, 3]
y = [2, 6, 4]

plt.plot(x, y, linestyle="dashed")

plt.show()
 

 

結果出力

 

編集
Post Share
子ページ

子ページはありません

同階層のページ
  1. 線のラベル
  2. マーカー
  3. 線の種類