暗い背景のスタイル シート#

この例は、通常は黒の要素 (テキスト、境界線など) に白を使用する「dark_background」スタイルを示しています。すべてのプロット要素がデフォルトで rc パラメータで定義された色になるわけではないことに注意してください。

「dark_background」スタイルシート
import numpy as np
import matplotlib.pyplot as plt


plt.style.use('dark_background')

fig, ax = plt.subplots()

L = 6
x = np.linspace(0, L)
ncolors = len(plt.rcParams['axes.prop_cycle'])
shift = np.linspace(0, L, ncolors, endpoint=False)
for s in shift:
    ax.plot(x, np.sin(x + s), 'o-')
ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')
ax.set_title("'dark_background' style sheet")

plt.show()

Sphinx-Gallery によって生成されたギャラリー