-
Notifications
You must be signed in to change notification settings - Fork 3
/
initial_mpl.py
76 lines (67 loc) · 2.96 KB
/
initial_mpl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import matplotlib.pyplot as plt
def init_plotting():
plt.rcParams['figure.figsize'] = (16, 9)
plt.rcParams['figure.dpi'] = 75
plt.rcParams['font.size'] = 16
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['axes.labelsize'] = 18
plt.rcParams['axes.titlesize'] = 20
plt.rcParams['legend.fontsize'] = plt.rcParams['font.size']
plt.rcParams['xtick.labelsize'] = plt.rcParams['font.size']
plt.rcParams['ytick.labelsize'] = plt.rcParams['font.size']
plt.rcParams['xtick.major.size'] = 3
plt.rcParams['xtick.minor.size'] = 3
plt.rcParams['xtick.major.width'] = 1
plt.rcParams['xtick.minor.width'] = 1
plt.rcParams['ytick.major.size'] = 3
plt.rcParams['ytick.minor.size'] = 3
plt.rcParams['ytick.major.width'] = 1
plt.rcParams['ytick.minor.width'] = 1
plt.rcParams['legend.frameon'] = True
plt.rcParams['legend.shadow'] = True
plt.rcParams['legend.loc'] = 'lower left'
plt.rcParams['legend.numpoints'] = 1
plt.rcParams['legend.scatterpoints'] = 1
plt.rcParams['axes.linewidth'] = 1
plt.rcParams['savefig.dpi'] = 300
plt.rcParams['xtick.minor.visible'] = 'False'
plt.rcParams['ytick.minor.visible'] = 'False'
plt.gca().xaxis.set_ticks_position('bottom')
plt.gca().yaxis.set_ticks_position('left')
plt.locator_params(nticks=4)
def cm2inch(value):
return value/2.54
def init_plotting_isi(*args):
if len(args) == 2:
xsize = cm2inch(float(args[0]))
ysize = cm2inch(float(args[1]))
else:
xsize = cm2inch(9.5)
ysize = cm2inch(11.)
plt.rcParams['figure.figsize'] = (xsize,ysize)
plt.rcParams['figure.dpi'] = 300
plt.rcParams['font.size'] = 8
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['axes.labelsize'] = 8
plt.rcParams['axes.titlesize'] = 8
plt.rcParams['legend.fontsize'] = 8
plt.rcParams['xtick.labelsize'] = 8
plt.rcParams['ytick.labelsize'] = 8
plt.rcParams['xtick.major.size'] = 2
plt.rcParams['xtick.minor.size'] = 1.5
plt.rcParams['xtick.major.width'] = 0.50
plt.rcParams['xtick.minor.width'] = 0.25
plt.rcParams['ytick.major.size'] = 2
plt.rcParams['ytick.minor.size'] = 1.5
plt.rcParams['ytick.major.width'] = 0.50
plt.rcParams['ytick.minor.width'] = 0.25
plt.rcParams['legend.frameon'] = True
plt.rcParams['legend.shadow'] = False
plt.rcParams['legend.loc'] = 'lower left'
plt.rcParams['legend.numpoints'] = 1
plt.rcParams['legend.scatterpoints'] = 1
plt.rcParams['axes.linewidth'] = 1
plt.rcParams['savefig.dpi'] = 300
plt.rcParams['xtick.minor.visible'] = 'False'
plt.rcParams['ytick.minor.visible'] = 'False'
plt.rcParams['patch.linewidth'] = .5