-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_PDF_ctrl_diff_compare.py
More file actions
38 lines (27 loc) · 1.7 KB
/
Copy pathplot_PDF_ctrl_diff_compare.py
File metadata and controls
38 lines (27 loc) · 1.7 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
from matplotlib.pyplot import *
from numpy import *
'''import files'''
import noNano_ctrl as nonano
import nano_ctrl as nnc
import peak_assign as pn
close("all")
f, ax = subplots(figsize=(20,6))
<<<<<<< HEAD
name_of_the_plot_nc=['%s h'%(array(nonano.x_value(nonano.Readfile)[i])) for i in range (shape(nonano.x_value(nonano.Readfile))[0])]
name_of_the_plot_nnc=['%s h'%(array(nnc.x_value(nnc.Readfile)[i])) for i in range (shape(nnc.x_value(nnc.Readfile))[0])]
=======
name_of_the_plot_nc=['%s h'%(array(nonano.x_value()[i])) for i in range (shape(nonano.x_value())[0])]
name_of_the_plot_nnc=['%s h'%(array(nnc.x_value()[i])) for i in range (shape(nnc.x_value())[0])]
>>>>>>> 4fd4d8775961b746663b468da51d99862c5c9d2e
[ax.plot(nonano.curve()[i][0],(np.array(nonano.curve()[i][1])-array(nonano.curve()[0][1]))*10 , '-',alpha=1,label='no nano, %s - 0 h'%(name_of_the_plot_nc[i])) for i in nonano.Readfile()[2]]
[ax.plot(nnc.curve()[i][0],(np.array(nnc.curve()[i][1])-array(nnc.curve()[0][1]))*10 + 5, '--',linewidth=1.5,alpha=1,label='nano, %s - 4.35 h'%(name_of_the_plot_nnc[i])) for i in nnc.Readfile()[2]]
legend(loc=0, fontsize ='small',ncol=2,columnspacing=0.5, labelspacing=0)
#add vertical lines at the local max
i_range = [0, 2, 5, 8]
lengthOftheLine = [0.92,0.9,0.9,0.9,0.9,0.9,0.8,0.8,0.9,0.9]
[ax.axvline(pn.find_local_max(nonano.curve())[1][i],ymin=0,ymax=lengthOftheLine[i],color='k') for i in i_range]
#add names of the peaks
position_y = [3.5,1,2.5 ,2.5, 3, 3,2,2.7,3.5]
[text(pn.find_local_max(nonano.curve())[1][i],position_y[i], pn.name_of_the_peak(nonano.curve())[i],horizontalalignment='center',fontsize=14) for i in i_range]
f.show()
# f.savefig('/Users/hty/desktop/diff pdf compare %s.pdf'%('full range'))