From d84538b395132d4abb223bd0363cd3683defa3ba Mon Sep 17 00:00:00 2001 From: Jue Xu Date: Sat, 3 Aug 2024 13:42:09 +0800 Subject: [PATCH] define set_fontsize func --- quantum_simulation_recipe/plot_config.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/quantum_simulation_recipe/plot_config.py b/quantum_simulation_recipe/plot_config.py index 5e9c363..9b19d8e 100644 --- a/quantum_simulation_recipe/plot_config.py +++ b/quantum_simulation_recipe/plot_config.py @@ -7,19 +7,6 @@ from matplotlib.colors import ListedColormap import colorsys -SMALL_SIZE = 14 -MEDIUM_SIZE = 18 #default 10 -LARGE_SIZE = 24 -# MARKER_SIZE = 10 - -plt.rc('font', size=MEDIUM_SIZE) # controls default text sizes -plt.rc('axes', titlesize=LARGE_SIZE) # fontsize of the axes title -plt.rc('axes', labelsize=LARGE_SIZE) # fontsize of the x and y labels -plt.rc('xtick', labelsize=LARGE_SIZE) # fontsize of the tick labels -plt.rc('ytick', labelsize=LARGE_SIZE) # fontsize of the tick labels -plt.rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize -plt.rc('figure', titlesize=LARGE_SIZE) # fontsize of the figure title - mpl.rcParams['font.family'] = 'sans-serif' # 'Helvetica' mpl.rcParams['axes.linewidth'] = 1.5 mpl.rcParams["xtick.direction"] = 'out' # 'out' @@ -43,6 +30,17 @@ mpl.rcParams['savefig.transparent'] = True +def set_fontsize(SMALL_SIZE=14, MEDIUM_SIZE=18, LARGE_SIZE=24): + plt.rc('font', size=MEDIUM_SIZE) # controls default text sizes + plt.rc('axes', titlesize=LARGE_SIZE) # fontsize of the axes title + plt.rc('axes', labelsize=LARGE_SIZE) # fontsize of the x and y labels + plt.rc('xtick', labelsize=LARGE_SIZE) # fontsize of the tick labels + plt.rc('ytick', labelsize=LARGE_SIZE) # fontsize of the tick labels + plt.rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize + plt.rc('figure', titlesize=LARGE_SIZE) # fontsize of the figure title + +set_fontsize() + # Function to lighten a color def lighten_color(color, amount=0.3): # Convert color from hexadecimal to RGB