注意
跳到末尾 以下载完整的示例代码。
Solarized Light 样式表#
这展示了“Solarized_Light”样式的一个示例,该样式试图复制
以及以下作品
使用调色板中的所有8种强调色——以蓝色开头
仍待完成
为条形图和堆叠图创建透明度值。 .33 或 .5
应用布局规则

import matplotlib.pyplot as plt
import numpy as np
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.linspace(0, 10)
with plt.style.context('Solarize_Light2'):
plt.plot(x, np.sin(x) + x + np.random.randn(50))
plt.plot(x, np.sin(x) + 2 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 3 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 4 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 5 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 6 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 7 * x + np.random.randn(50))
plt.plot(x, np.sin(x) + 8 * x + np.random.randn(50))
# Number of accent colors in the color scheme
plt.title('8 Random Lines - Line')
plt.xlabel('x label', fontsize=14)
plt.ylabel('y label', fontsize=14)
plt.show()