|
| 1 | +""" |
| 2 | +========================== |
| 3 | +Solarized Light stylesheet |
| 4 | +========================== |
| 5 | +
|
| 6 | +This shows an example of "Solarized_Light" styling, which |
| 7 | +tries to replicate the styles of: |
| 8 | +
|
| 9 | + - `<http://ethanschoonover.com/solarized>`__ |
| 10 | + - `<https://github.com/jrnold/ggthemes>`__ |
| 11 | + - `<http://pygal.org/en/stable/documentation/builtin_styles.html#light-solarized>`__ |
| 12 | +
|
| 13 | +and work of: |
| 14 | +
|
| 15 | + - `<https://github.com/tonysyu/mpltools>`__ |
| 16 | +
|
| 17 | +using all 8 accents of the color palette - starting with blue |
| 18 | +
|
| 19 | +ToDo: |
| 20 | + - Create alpha values for bar and stacked charts. .33 or .5 |
| 21 | + - Apply Layout Rules |
| 22 | +""" |
| 23 | +from matplotlib import pyplot as plt |
| 24 | +import numpy as np |
| 25 | +x = np.linspace(0, 10) |
| 26 | +with plt.style.context('Solarize_Light2'): |
| 27 | + plt.plot(x, np.sin(x) + x + np.random.randn(50)) |
| 28 | + plt.plot(x, np.sin(x) + 2 * x + np.random.randn(50)) |
| 29 | + plt.plot(x, np.sin(x) + 3 * x + np.random.randn(50)) |
| 30 | + plt.plot(x, np.sin(x) + 4 + np.random.randn(50)) |
| 31 | + plt.plot(x, np.sin(x) + 5 * x + np.random.randn(50)) |
| 32 | + plt.plot(x, np.sin(x) + 6 * x + np.random.randn(50)) |
| 33 | + plt.plot(x, np.sin(x) + 7 * x + np.random.randn(50)) |
| 34 | + plt.plot(x, np.sin(x) + 8 * x + np.random.randn(50)) |
| 35 | + # Number of accent colors in the color scheme |
| 36 | + plt.title('8 Random Lines - Line') |
| 37 | + plt.xlabel('x label', fontsize=14) |
| 38 | + plt.ylabel('y label', fontsize=14) |
| 39 | + |
| 40 | +plt.show() |
0 commit comments