Skip to content

Commit

Permalink
define set_fontsize func
Browse files Browse the repository at this point in the history
  • Loading branch information
Jue-Xu committed Aug 3, 2024
1 parent 9513930 commit d84538b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions quantum_simulation_recipe/plot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit d84538b

Please sign in to comment.