Skip to content

Commit 1ae0107

Browse files
committed
update set_plot_style()
1 parent d11c27a commit 1ae0107

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

src/color_palette.jl

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,24 @@ end
7070
Set the default style for plots using LaTeX.
7171
"""
7272
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
9691
end
9792

9893
# """

0 commit comments

Comments
 (0)