Repository navigation
Expand file tree
/
Copy pathplot_graph.py
More file actions
59 lines (49 loc) · 2.05 KB
/
Copy pathplot_graph.py
File metadata and controls
59 lines (49 loc) · 2.05 KB
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
from matplotlib import pyplot as plt
from matplotlib import ticker
def plot_graph(x, y,xlabel,ylabel,color,linestyle,linewidth,marker,markersize):
plt.rcParams["axes.linewidth"] = 2.5
plt.rcParams.update({'figure.autolayout': True})
size=30
ticksize=30
family="Times New Roman"
font = {'family' : family,
'weight' : 'bold',
'style' : 'normal',
'size' : size}
plt.rcParams["figure.figsize"] = (10,7)
plt.rcParams['figure.constrained_layout.use'] = True
plt.plot(x,y, color=color, linestyle=linestyle,linewidth=linewidth,marker=marker,markersize=markersize)
plt.xlabel(xlabel,font)
plt.ylabel(ylabel,font)
plt.xticks(fontweight='bold',fontsize=ticksize,fontfamily=family)
plt.yticks(fontweight='bold',fontsize=ticksize,fontfamily=family)
return plt
def plot_graph_errorbar(x, y,yerr,xlabel,ylabel,color,linestyle,linewidth,marker,markersize):
plt.rcParams["axes.linewidth"] = 2.50
plt.rcParams.update({'figure.autolayout': True})
size=30
ticksize=30
family="Times New Roman"
font = {'family' : family,
'weight' : 'bold',
'style' : 'normal',
'size' : size}
plt.rcParams["figure.figsize"] = (10,7)
plt.rcParams['figure.constrained_layout.use'] = True
plt.errorbar(x,y,yerr=yerr,color=color, linestyle=linestyle,linewidth=linewidth,marker=marker,markersize=markersize)
plt.xlabel(xlabel,font)
plt.ylabel(ylabel,font)
plt.xticks(fontweight='bold',fontsize=ticksize,fontfamily=family)
plt.yticks(fontweight='bold',fontsize=ticksize,fontfamily=family)
return plt
def plot_graph_fillerrorbar(x,ylowerr,yhierr,edgecolor,facecolor,linewidth,alpha):
plt.rcParams["axes.linewidth"] = 1
size=1
family="Times New Roman"
font = {'family' : family,
'weight' : 'bold',
'style' : 'normal',
'size' : size}
plt.rcParams["figure.figsize"] = (18, 10)
plt.fill_between(x,ylowerr,yhierr,edgecolor=edgecolor,facecolor=facecolor,linewidth=linewidth,alpha=alpha)
return plt