これは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()
 

 

結果出力