|
3 | 3 | # Released under the BSD License
|
4 | 4 | # -----------------------------------------------------------------------------
|
5 | 5 |
|
6 |
| -# Scripts to generate all the basic plots |
| 6 | +# Script to generate all the basic plots |
| 7 | +import pathlib |
| 8 | + |
7 | 9 | import numpy as np
|
8 | 10 | import matplotlib as mpl
|
9 | 11 | import matplotlib.pyplot as plt
|
10 | 12 |
|
11 |
| -fig = plt.figure(figsize=(0.4,0.4)) |
12 |
| -mpl.rcParams['axes.linewidth'] = 0.5 |
13 |
| -mpl.rcParams['xtick.major.size'] = 0.0 |
14 |
| -mpl.rcParams['ytick.major.size'] = 0.0 |
| 13 | + |
| 14 | +mpl.style.use(pathlib.Path(__file__).parent/'../styles/plotlet.mplstyle') |
| 15 | + |
| 16 | +fig = plt.figure() |
15 | 17 | d = 0.01
|
16 | 18 | ax = fig.add_axes([d,d,1-2*d,1-2*d])
|
17 | 19 |
|
18 | 20 | # Basic line plot
|
19 | 21 | # -----------------------------------------------------------------------------
|
20 | 22 | X = np.linspace(0, 10, 100)
|
21 | 23 | Y = 4+2*np.sin(2*X)
|
22 |
| -ax.plot(X, Y, color="C1", linewidth=0.75) |
| 24 | +ax.plot(X, Y, color="C1") |
23 | 25 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
24 | 26 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
25 |
| -ax.grid(linewidth=0.125) |
| 27 | +ax.grid() |
26 | 28 | plt.savefig("../figures/basic-plot.pdf")
|
27 | 29 | ax.clear()
|
28 | 30 |
|
|
31 | 33 | # -----------------------------------------------------------------------------
|
32 | 34 | X = np.linspace(0, 10, 100)
|
33 | 35 | Y = 4+2*np.sin(2*X)
|
34 |
| -ax.plot(X, Y, color="black", linewidth=0.75) |
| 36 | +ax.plot(X, Y, color="black") |
35 | 37 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
36 | 38 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
37 |
| -ax.grid(linewidth=0.125) |
| 39 | +ax.grid() |
38 | 40 | plt.savefig("../figures/basic-plot-color.pdf")
|
39 | 41 | ax.clear()
|
40 | 42 |
|
|
47 | 49 | edgecolor="white", facecolor="C1", linewidth=0.25)
|
48 | 50 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
49 | 51 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
50 |
| -ax.grid(linewidth=0.125) |
| 52 | +ax.grid() |
51 | 53 | plt.savefig("../figures/basic-scatter.pdf")
|
52 | 54 | ax.clear()
|
53 | 55 |
|
|
61 | 63 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
62 | 64 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
63 | 65 | ax.set_axisbelow(True)
|
64 |
| -ax.grid(linewidth=0.125) |
| 66 | +ax.grid() |
65 | 67 | plt.savefig("../figures/basic-bar.pdf")
|
66 | 68 | ax.clear()
|
67 | 69 |
|
|
95 | 97 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
96 | 98 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
97 | 99 | # ax.set_axisbelow(True)
|
98 |
| -# ax.grid(linewidth=0.125, color="0.75") |
| 100 | +# ax.grid(color="0.75") |
99 | 101 | plt.savefig("../figures/basic-contour.pdf")
|
100 | 102 | ax.clear()
|
101 | 103 |
|
|
140 | 142 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
141 | 143 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
142 | 144 | ax.set_axisbelow(True)
|
143 |
| -ax.grid(linewidth=0.125, color="0.75") |
| 145 | +ax.grid(color="0.75") |
144 | 146 | plt.savefig("../figures/basic-fill.pdf")
|
145 | 147 | ax.clear()
|
146 | 148 |
|
|
155 | 157 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
|
156 | 158 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
|
157 | 159 | ax.set_axisbelow(True)
|
158 |
| -ax.grid(linewidth=0.125, color="0.75") |
| 160 | +ax.grid(color="0.75") |
159 | 161 | plt.savefig("../figures/basic-quiver.pdf")
|
160 | 162 | ax.clear()
|
0 commit comments