注解
Click here 下载完整的示例代码
日光灯样式表¶
这显示了一个“日光灯”样式的示例,它尝试复制以下样式:
- http://ethanschoonover.com/solarized
- https://github.com/jrnold/ggthemes
- http://www.pygal.org/en/stable/documentation/builtin_styles.htmllight-日晒
和工作:
使用调色板的全部8个重音-从蓝色开始
ToDo:
- 为条形图和堆积图创建alpha值。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 + 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()
关键词:matplotlib代码示例,codex,python plot,pyplot Gallery generated by Sphinx-Gallery