|
70 | 70 | Set the default style for plots using LaTeX. |
71 | 71 | """ |
72 | 72 | function set_plot_style() |
73 | | - default( |
74 | | - fontfamily="Computer Modern", |
75 | | - titlefontsize=14, |
76 | | - guidefontsize=12, |
77 | | - tickfontsize=10, |
78 | | - legendfontsize=10, |
79 | | - linewidth=1, |
80 | | - markersize=6, |
81 | | - size=(600, 400), |
82 | | - grid=true, |
83 | | - gridstyle=:dash, |
84 | | - gridcolor=:gray, |
85 | | - gridalpha=0.3 |
86 | | - ) |
87 | | - |
88 | | - # LaTeX settings if using PGFPlotsX backend |
89 | | - if backend() isa PGFPlotsX |
90 | | - pgfplotsx( |
91 | | - tex_output_standalone=true, |
92 | | - pdf_engine="pdflatex", |
93 | | - latex_engine="pdflatex" |
94 | | - ) |
95 | | - end |
| 73 | + # plt.style.use('seaborn-whitegrid') |
| 74 | + plt.style.use("seaborn-v0_8-whitegrid") |
| 75 | + rcParams = plt.PyDict(plt.matplotlib."rcParams") |
| 76 | + rcParams["text.usetex"] = true |
| 77 | + rcParams["font.family"] = "serif" |
| 78 | + rcParams["font.serif"] = ["Computer Modern Roman"] |
| 79 | + rcParams["axes.titlesize"] = 14 |
| 80 | + rcParams["axes.labelsize"] = 12 |
| 81 | + rcParams["axes.linewidth"] = 1 |
| 82 | + rcParams["lines.linewidth"] = 1 |
| 83 | + rcParams["lines.markersize"] = 6 |
| 84 | + rcParams["xtick.labelsize"] = 10 |
| 85 | + rcParams["ytick.labelsize"] = 10 |
| 86 | + rcParams["legend.fontsize"] = 10 |
| 87 | + rcParams["figure.titlesize"] = 16 |
| 88 | + rcParams["pgf.texsystem"] = "pdflatex" # Use pdflatex |
| 89 | + rcParams["pgf.rcfonts"] = false |
| 90 | + rcParams["figure.figsize"] = (10, 6) # Default figure size |
96 | 91 | end |
97 | 92 |
|
98 | 93 | # """ |
|
0 commit comments