色設定

カラーサイクル

デフォルト

デフォルト(matplotlib 3.3.2)のカラーサイクルは10色.

fig, ax = plt.subplots(1, 1)
ax.set_xlabel('test $x$')
ax.set_ylabel('test $y$')
#ax.legend(loc='best', frameon=True)

for i in range(12):
    ax.plot([i + 1, i + 2 , i + 3, i + 4])

カラーサイクルのn番目の色を使用

例えば0番目(デフォルトだと青っぽい色)の色を使いたい場合はC0で使用可能.

fig, ax = plt.subplots(1, 1)
ax.set_xlabel('test $x$')
ax.set_ylabel('test $y$')
#ax.legend(loc='best', frameon=True)

for i in range(12):
    ax.plot([i + 1, i + 2 , i + 3, i + 4], 'C0')
前へ
次へ