以下の内容はhttps://phst.hateblo.jp/entry/2023/12/26/080000より取得しました。


Python+matplotlib で点線や破線の間隔を変える

直線で描く場合。

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([0,1],[0,1])
plt.show()

dashes 変数を使うと、点線の色あり、色なしの部分の幅を指定できる。以下はその例。

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([0,1],[0,1],dashes=[1,1])
plt.show()

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([0,1],[0,1],dashes=[4,1])
plt.show()

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([0,1],[0,1],dashes=[4,1,2])
plt.show()




以上の内容はhttps://phst.hateblo.jp/entry/2023/12/26/080000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14