|
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 |
|
29 | 31 | # Basic line plot (color)blaPwd |
30 | 32 |
|
31 | 33 | # ----------------------------------------------------------------------------- |
32 | 34 | X = np.linspace(0, 10, 100) |
33 | | -Y = 4 + 2 * np.sin(2 * X) |
34 | | -ax.plot(X, Y, color="black", linewidth=0.75) |
| 35 | +Y = 4 + 2*np.sin(2*X) |
| 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 |
|
|
142 | 144 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1, 8)) |
143 | 145 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1, 8)) |
144 | 146 | ax.set_axisbelow(True) |
145 | | -ax.grid(linewidth=0.125, color="0.75") |
| 147 | +ax.grid(color="0.75") |
146 | 148 | plt.savefig("../figures/basic-fill.pdf") |
147 | 149 | ax.clear() |
148 | 150 |
|
|
157 | 159 | ax.set_xlim(0, 8), ax.set_xticks(np.arange(1, 8)) |
158 | 160 | ax.set_ylim(0, 8), ax.set_yticks(np.arange(1, 8)) |
159 | 161 | ax.set_axisbelow(True) |
160 | | -ax.grid(linewidth=0.125, color="0.75") |
| 162 | +ax.grid(color="0.75") |
161 | 163 | plt.savefig("../figures/basic-quiver.pdf") |
162 | 164 | ax.clear() |
0 commit comments