FiveThirtyEight样式表
这显示了“fivethirtyeight”样式的一个示例,它试图从FiveThirtyEight.com复制样式。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| import matplotlib.pyplot as plt import numpy as np
plt.style.use('fivethirtyeight')
x = np.linspace(0, 10)
np.random.seed(19680801)
fig, ax = plt.subplots()
ax.plot(x, np.sin(x) + x + np.random.randn(50)) ax.plot(x, np.sin(x) + 0.5 * x + np.random.randn(50)) ax.plot(x, np.sin(x) + 2 * x + np.random.randn(50)) ax.plot(x, np.sin(x) - 0.5 * x + np.random.randn(50)) ax.plot(x, np.sin(x) - 2 * x + np.random.randn(50)) ax.plot(x, np.sin(x) + np.random.randn(50)) ax.set_title("'fivethirtyeight' style sheet")
plt.show()
|
下载这个示例