6969
7070Set the default style for plots using LaTeX.
7171"""
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
72+ function set_plot_style (titel_size= 16 )
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" ] = titel_size
80+ # rcParams["axes.ymargin"] = 0.1
81+ rcParams[" axes.labelsize" ] = 12
82+ rcParams[" axes.linewidth" ] = 1
83+ rcParams[" lines.linewidth" ] = 1
84+ rcParams[" lines.markersize" ] = 6
85+ rcParams[" xtick.labelsize" ] = 10
86+ rcParams[" ytick.labelsize" ] = 10
87+ rcParams[" legend.fontsize" ] = 10
88+ rcParams[" figure.titlesize" ] = 16
89+ rcParams[" pgf.texsystem" ] = " pdflatex" # Use pdflatex
90+ rcParams[" pgf.rcfonts" ] = false
91+ rcParams[" figure.figsize" ] = (10 , 6 ) # Default figure size
9692end
9793
98- """
99- apply_palette!(p::Plots.Plot, colors::Vector{String})
94+ # """
95+ # apply_palette!(p::Plots.Plot, colors::Vector{String})
10096
101- Apply the color palette to a plot.
102- """
103- function apply_palette! (p:: Plots.Plot , colors:: Vector{String} )
104- for (i, series) in enumerate (p. series_list)
105- color_name = colors[mod1 (i, length (colors))]
106- series. plotattributes[:linecolor ] = get_color (color_name)
107- end
108- return p
109- end
97+ # Apply the color palette to a plot.
98+ # """
99+ # function apply_palette!(p::Plots.Plot, colors::Vector{String})
100+ # for (i, series) in enumerate(p.series_list)
101+ # color_name = colors[mod1(i, length(colors))]
102+ # series.plotattributes[:linecolor] = get_color(color_name)
103+ # end
104+ # return p
105+ # end
0 commit comments