我们经常需要导入数据,按列提取 XY作图

方法一、

filename='/home/res/user/csluo/test.txt'                    #将文件名赋值为变量X,Y,Z=[ ],[ ],[ ]                                           #给三个空列表with open(filename, 'r') as f:                              #打开文档lines=f.readlines()                                     #按行读取数据for i in lines:value=[ float(s) for s in line.split( ) ]      #将 行数据 以空格分开,并以浮点型赋给value  X.append(value[0])                            #将value 的第一个数值 添加到 列表XY.append(value[1])Z.append(value[2])

方法二、

a = numpy.loadtxt('a.txt')a[:,0]

方法三、

>>> import pandas as pd
>>> data = pd.read_csv("aaa.csv")

附录:IRAS16293 的数据 绘图代码

import matplotlib
import matplotlib.pyplot as plt
import numpy as np##################################################################
######################################################################################### ######## 1
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A1_145122-145580.txt'
X10,Y10= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]         #以空格分开 行 并输出 浮点数X10.append(value[0])Y10.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A1/xclass_spectrum_output.dat'
X11,Y11 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X11.append(value[0])Y11.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A1/xclass_spectrum_output.dat'
X12,Y12 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X12.append(value[0])Y12.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A1/xclass_spectrum_output.dat'
X13,Y13 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X13.append(value[0])Y13.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A1/xclass_spectrum_output.dat'
X14,Y14 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X14.append(value[0])Y14.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B1_145122-145580.txt'
X15,Y15= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X15.append(value[0])Y15.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B1/xclass_spectrum_output.dat'
X16,Y16 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X16.append(value[0])Y16.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B1/xclass_spectrum_output.dat'
X17,Y17 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X17.append(value[0])Y17.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B1/xclass_spectrum_output.dat'
X18,Y18 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X18.append(value[0])Y18.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B1/xclass_spectrum_output.dat'
X19,Y19 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X19.append(value[0])Y19.append(value[1])###################################################################   #2 plotplt.figure(1)
plt.subplot(211)
plt.axis([145122,145580, -1, 15])new_ticks = np.linspace(145122,145580,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X10,Y10,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X11,Y11,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X12,Y12,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X13,Y13,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X14,Y14,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(145535,13,'IRAS16293A')#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([145122,145580, -1, 15])new_ticks = np.linspace(145122,145580,10)
plt.xticks(new_ticks)plt.plot(X15,Y15,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X16,Y16,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X17,Y17,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X18,Y18,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X19,Y19,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(145535,13,'IRAS16293B')plt.plot([145263,145263],[1,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("C2H5OH", xy = (145263,1), xytext = (145280,9),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()##################################################################
######################################################################################### ######## 2
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A2_145580-146050.txt'
X20,Y20= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X20.append(value[0])Y20.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A2/xclass_spectrum_output.dat'
X21,Y21 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X21.append(value[0])Y21.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A2/xclass_spectrum_output.dat'
X22,Y22 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X22.append(value[0])Y22.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A2/xclass_spectrum_output.dat'
X23,Y23 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X23.append(value[0])Y23.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A2/xclass_spectrum_output.dat'
X24,Y24 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X24.append(value[0])Y24.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B2.txt'
X25,Y25= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X25.append(value[0])Y25.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B2/xclass_spectrum_output.dat'
X26,Y26 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X26.append(value[0])Y26.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B2/xclass_spectrum_output.dat'
X27,Y27 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X27.append(value[0])Y27.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B2/xclass_spectrum_output.dat'
X28,Y28 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X28.append(value[0])Y28.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B2/xclass_spectrum_output.dat'
X29,Y29 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X29.append(value[0])Y29.append(value[1])###################################################################   #2 plotplt.figure(2)
plt.subplot(211)
plt.axis([145580,146050, -1, 15])new_ticks = np.linspace(145580,146050,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X20,Y20,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X21,Y21,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X22,Y22,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X23,Y23,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X24,Y24,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146000,13,'IRAS16293A')plt.plot([145618.5,145618.5],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (145618,7), xytext = (145650,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146020,146020],[7,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146020,6), xytext = (146005,10),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([145580,146050, -1, 15])new_ticks = np.linspace(145580,146050,10)
plt.xticks(new_ticks)plt.plot(X25,Y25,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X26,Y26,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X27,Y27,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X28,Y28,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X29,Y29,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146000,13,'IRAS16293B')plt.plot([145618.5,145618.5],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (145618,7), xytext = (145650,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146020,146020],[7,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146020,6), xytext = (145990,10),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()##################################################################
######################################################################################### ######## 3
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A3.txt'
X30,Y30= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X30.append(value[0])Y30.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A3/xclass_spectrum_output.dat'
X31,Y31 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X31.append(value[0])Y31.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A3/xclass_spectrum_output.dat'
X32,Y32 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X32.append(value[0])Y32.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A3/xclass_spectrum_output.dat'
X33,Y33 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X33.append(value[0])Y33.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A3/xclass_spectrum_output.dat'
X34,Y34 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X34.append(value[0])Y34.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B3_146050-146507.txt'
X35,Y35= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X35.append(value[0])Y35.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B3/xclass_spectrum_output.dat'
X36,Y36 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X36.append(value[0])Y36.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B3/xclass_spectrum_output.dat'
X37,Y37 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X37.append(value[0])Y37.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B3/xclass_spectrum_output.dat'
X38,Y38 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X38.append(value[0])Y38.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B3/xclass_spectrum_output.dat'
X39,Y39 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X39.append(value[0])Y39.append(value[1])###################################################################   #2 plotplt.figure(3)
plt.subplot(211)
plt.axis([146050,146507, -1, 15])new_ticks = np.linspace(146050,146507,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X30,Y30,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X31,Y31,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X32,Y32,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X33,Y33,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X34,Y34,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146465,13,'IRAS16293A')plt.plot([146172,146172],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146172,7), xytext = (146190,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146232,146232],[3,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146232,10), xytext = (146210,5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146343,146343],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146343,7), xytext = (146320,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146355,146355],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146355,6), xytext = (146380,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([146050,146507, -1, 15])new_ticks = np.linspace(146050,146507,10)
plt.xticks(new_ticks)plt.plot(X35,Y35,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X36,Y36,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X37,Y37,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X38,Y38,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X39,Y39,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146465,13,'IRAS16293B')plt.plot([146343,146343],[5.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146343,7), xytext = (146320,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([146355,146355],[5.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (146355,6), xytext = (146380,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.plot([157324,157324],[2.5,15], color ='grey', linewidth=1, linestyle="--")
#plt.annotate("CH3COCH3", xy = (157324,3), xytext = (157347,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()##################################################################
######################################################################################### ######## 4
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A4'
X40,Y40= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X40.append(value[0])Y40.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A4/xclass_spectrum_output.dat'
X41,Y41 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X41.append(value[0])Y41.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A4/xclass_spectrum_output.dat'
X42,Y42 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X42.append(value[0])Y42.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A4/xclass_spectrum_output.dat'
X43,Y43 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X43.append(value[0])Y43.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A4/xclass_spectrum_output.dat'
X44,Y44 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X44.append(value[0])Y44.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B4_146507-146976.txt'
X45,Y45= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X45.append(value[0])Y45.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B4/xclass_spectrum_output.dat'
X46,Y46 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X46.append(value[0])Y46.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B4/xclass_spectrum_output.dat'
X47,Y47 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X47.append(value[0])Y47.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B4/xclass_spectrum_output.dat'
X48,Y48 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X48.append(value[0])Y48.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B4/xclass_spectrum_output.dat'
X49,Y49 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X49.append(value[0])Y49.append(value[1])###################################################################   #2 plotplt.figure(4)
plt.subplot(211)
plt.axis([146507,146976, -1, 15])new_ticks = np.linspace(146507,146976,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X40,Y40,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X41,Y41,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X42,Y42,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X43,Y43,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X44,Y44,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146930,13,'IRAS16293A')#plt.plot([157323,157323],[2.5,15], color ='grey', linewidth=1, linestyle="--")
#plt.annotate("CH3COCH3", xy = (157323,3), xytext = (157345,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([146507,146976, -1, 15])new_ticks = np.linspace(146507,146976,10)
plt.xticks(new_ticks)plt.plot(X45,Y45,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X46,Y46,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X47,Y47,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X48,Y48,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X49,Y49,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(146930,13,'IRAS16293B')#plt.plot([157324,157324],[2.5,15], color ='grey', linewidth=1, linestyle="--")
#plt.annotate("CH3COCH3", xy = (157324,3), xytext = (157347,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()##################################################################
######################################################################################### ######## 5
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A5_156840-157303.txt'
X50,Y50= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X50.append(value[0])Y50.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A5/xclass_spectrum_output.dat'
X51,Y51 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X51.append(value[0])Y51.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A5/xclass_spectrum_output.dat'
X52,Y52 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X52.append(value[0])Y52.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A5/xclass_spectrum_output.dat'
X53,Y53 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X53.append(value[0])Y53.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A5/xclass_spectrum_output.dat'
X54,Y54 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X54.append(value[0])Y54.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B5_156840-157303.txt'
X55,Y55= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X55.append(value[0])Y55.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B5/xclass_spectrum_output.dat'
X56,Y56 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X56.append(value[0])Y56.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B5/xclass_spectrum_output.dat'
X57,Y57 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X57.append(value[0])Y57.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B5/xclass_spectrum_output.dat'
X58,Y58 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X58.append(value[0])Y58.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B5/xclass_spectrum_output.dat'
X59,Y59 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X59.append(value[0])Y59.append(value[1])###################################################################   #2 plotplt.figure(5)
plt.subplot(211)
plt.axis([156840, 157303, -1, 15])new_ticks = np.linspace(156840,157303,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X50,Y50,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X51,Y51,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X52,Y52,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X53,Y53,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X54,Y54,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(157256,13,'IRAS16293A')#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([156820,157303, -1, 15])new_ticks = np.linspace(156820,157303,10)
plt.xticks(new_ticks)plt.plot(X55,Y55,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X56,Y56,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X57,Y57,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X58,Y58,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X59,Y59,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(157255,13,'IRAS16293B')#plt.plot([157324,157324],[2.5,15], color ='grey', linewidth=1, linestyle="--")
#plt.annotate("CH3COCH3", xy = (157324,3), xytext = (157347,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()##################################################################
######################################################################################### ######## 6
###################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A6_157303-157820.txt'
X60,Y60= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X60.append(value[0])Y60.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A6/xclass_spectrum_output.dat'
X61,Y61 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X61.append(value[0])Y61.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A6/xclass_spectrum_output.dat'
X62,Y62 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X62.append(value[0])Y62.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A6/xclass_spectrum_output.dat'
X63,Y63 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X63.append(value[0])Y63.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A6/xclass_spectrum_output.dat'
X64,Y64 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X64.append(value[0])Y64.append(value[1])###################################################   data_bfilename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B6_157303-157820.txt'
X65,Y65= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X65.append(value[0])Y65.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B6/xclass_spectrum_output.dat'
X66,Y66 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X66.append(value[0])Y66.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B6/xclass_spectrum_output.dat'
X67,Y67 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X67.append(value[0])Y67.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B6/xclass_spectrum_output.dat'
X68,Y68 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X68.append(value[0])Y68.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B6/xclass_spectrum_output.dat'
X69,Y69 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X69.append(value[0])Y69.append(value[1])###################################################################   #2 plotplt.figure(6)
plt.subplot(211)
plt.axis([157303, 157820, -1, 15])new_ticks = np.linspace(157303, 157820,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X60,Y60,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X61,Y61,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X62,Y62,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X63,Y63,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X64,Y64,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(157765,13,'IRAS16293A')plt.plot([157323,157323],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (157323,3), xytext = (157345,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([157303, 157820, -1, 15])new_ticks = np.linspace(157303, 157820,10)
plt.xticks(new_ticks)plt.plot(X65,Y65,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X66,Y66,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X67,Y67,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X68,Y68,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X69,Y69,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(157765,13,'IRAS16293B')plt.plot([157324,157324],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (157324,3), xytext = (157347,4.5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([157505.5,157505.5],[5.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("C2H5OH", xy = (157505,6), xytext = (157450,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()###############################################################################################
################################################################################################################ 7
################################################################################################data_a
filename = '/home/luoluo/Documents/python_scripts/Adata_cut/A7_157820-158228.txt'
X70,Y70= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X70.append(value[0])Y70.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A7/xclass_spectrum_output.dat'
X71,Y71 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X71.append(value[0])Y71.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A7/xclass_spectrum_output.dat'
X72,Y72 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X72.append(value[0])Y72.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A7/xclass_spectrum_output.dat'
X73,Y73 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X73.append(value[0])Y73.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A7/xclass_spectrum_output.dat'
X74,Y74 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X74.append(value[0])Y74.append(value[1])
#########################################################
#data_b
filename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B7_157820-158228.txt'
X75,Y75= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X75.append(value[0])Y75.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B7/xclass_spectrum_output.dat'
X76,Y76 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X76.append(value[0])Y76.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B7/xclass_spectrum_output.dat'
X77,Y77 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X77.append(value[0])Y77.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B7/xclass_spectrum_output.dat'
X78,Y78 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X78.append(value[0])Y78.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B7/xclass_spectrum_output.dat'
X79,Y79 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X79.append(value[0])Y79.append(value[1])
#############################################################################################################################################
#2 plot
plt.figure(7)
plt.subplot(211)
plt.axis([157820, 158228, -1, 15])new_ticks = np.linspace(157820,158228,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X70,Y70,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X71,Y71,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X72,Y72,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X73,Y73,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X74,Y74,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(158183,13,'IRAS16293A')plt.plot([157894,157894],[5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (157895,7), xytext = (157880,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158120,158120],[5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158120,5), xytext = (158110,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158172,158172],[7,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158171,8), xytext = (158150,10),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158225,158225],[4,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158225,5), xytext = (158200,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([157820, 158228, -1, 15])new_ticks = np.linspace(157820, 158228,10)
plt.xticks(new_ticks)plt.plot(X75,Y75,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X76,Y76,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X77,Y77,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X78,Y78,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X79,Y79,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(158183,13,'IRAS16293B')plt.plot([157895,157895],[5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (157896,7), xytext = (157880,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158121,158121],[5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158121,7), xytext = (158110,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158173,158173],[7,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158172,8), xytext = (158150,5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158226,158226],[4,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158225,5), xytext = (158205,10),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.plot([158389,158389],[3.5,15], color ='grey', linewidth=1, linestyle="--")
#plt.annotate("CH3OCHO v18=1", xy = (158390,5), xytext = (158400,13),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()
######################################################################################
###################################################################################### ###### 8
#######################################################################################
#1 import data#data_a
filename = 'Adata_cut/A8_158228-158680.txt'
X80,Y80= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X80.append(value[0])Y80.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A8/xclass_spectrum_output.dat'
X81,Y81 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X81.append(value[0])Y81.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A8/xclass_spectrum_output.dat'
X82,Y82 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X82.append(value[0])Y82.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A8/xclass_spectrum_output.dat'
X83,Y83 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X83.append(value[0])Y83.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A8/xclass_spectrum_output.dat'
X84,Y84 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X84.append(value[0])Y84.append(value[1])
#########################################################
#data_b
filename = 'Bdata_cut/B8_158228-158680.txt'
X85,Y85= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X85.append(value[0])Y85.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B8/xclass_spectrum_output.dat'
X86,Y86 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X86.append(value[0])Y86.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B8/xclass_spectrum_output.dat'
X87,Y87 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X87.append(value[0])Y87.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B8/xclass_spectrum_output.dat'
X88,Y88 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X88.append(value[0])Y88.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B8/xclass_spectrum_output.dat'
X89,Y89 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X89.append(value[0])Y89.append(value[1])
#############################################################
#2 plot
plt.figure(8)
plt.subplot(211)
plt.axis([158228, 158680, -1, 15])new_ticks = np.linspace(158228,158680,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X80,Y80,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X81,Y81,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X82,Y82,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X83,Y83,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X84,Y84,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(158635,13,'IRAS16293A')plt.plot([158378,158378],[1.9,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158378, 2.0), xytext = (158300,5),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158388,158388],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158388, 4.5), xytext = (158370,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158430,158430],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158430, 3.5), xytext = (158400,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158484,158484],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158485, 4), xytext = (158450,9),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158519,158519],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158518,4), xytext = (158490,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158540,158540],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158541,4), xytext = (158550,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158675,158675],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158674,3), xytext = (158610,8),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.show()
#plt.savefig('8.png')plt.subplot(212)
plt.axis([158228, 158680, -1, 15])new_ticks = np.linspace(158228,158680,10)
plt.xticks(new_ticks)plt.plot(X85,Y85,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X86,Y86,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X87,Y87,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X88,Y88,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X89,Y89,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(158635,13,'IRAS16293B')
plt.plot([158389,158389],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158390,5), xytext = (158400,13),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158484,158484],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158484,5), xytext = (158430,4),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158520,158520],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158520,4), xytext = (158500,6),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158540,158540],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158540,4), xytext = (158570,11),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158675,158675],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158675,4), xytext = (158640,8),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()####################################################################################################
#################################################################################################### ######## 9
#####################################################################################################data_afilename = '/home/luoluo/Documents/python_scripts/Adata_cut/A9_158680-159155.txt'
X90,Y90= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X90.append(value[0])Y90.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_A/A9/xclass_spectrum_output.dat'
X91,Y91 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X91.append(value[0])Y91.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_A/A9/xclass_spectrum_output.dat'
X92,Y92 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X92.append(value[0])Y92.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_A/A9/xclass_spectrum_output.dat'
X93,Y93 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X93.append(value[0])Y93.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_A/A9/xclass_spectrum_output.dat'
X94,Y94 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X94.append(value[0])Y94.append(value[1])
#########################################################
#data_b
filename = '/home/luoluo/Documents/python_scripts/Bdata_cut/B9_158680-159155.txt'
X95,Y95= [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X95.append(value[0])Y95.append(value[1])#c2h5oh
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__C2H5OH_B/B9/xclass_spectrum_output.dat'
X96,Y96 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X96.append(value[0])Y96.append(value[1])#ch3coch3
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3COCH3_B/B9/xclass_spectrum_output.dat'
X97,Y97 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X97.append(value[0])Y97.append(value[1])#ch3ocho_v18=1
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v18=1_B/B9/xclass_spectrum_output.dat'
X98,Y98 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X98.append(value[0])Y98.append(value[1])#ch3ocho_v=0
filename = '/home/luoluo/Documents/python_scripts/job__XCLASS/job__CH3OCHO_v=0_B/B9/xclass_spectrum_output.dat'
X99,Y99 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X99.append(value[0])Y99.append(value[1])###2 plot
plt.figure(9)
#A
plt.subplot(211)
plt.axis([158680, 159155, -1, 15])new_ticks = np.linspace(158680,159155,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'
plt.plot(X90,Y90,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X91,Y91,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X92,Y92,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X93,Y93,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X94,Y94,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
#plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(159110,13,'IRAS16293A')plt.plot([158691,158691],[8,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158691, 5), xytext = (158730,3),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158701.9,158701.9],[8,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158701, 10), xytext = (158770,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([159003.5,159003.5],[3.4,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (159005, 3), xytext = (159020,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([159106,159106],[3.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (159107, 3.5), xytext = (159110,7),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#B
plt.subplot(212)
plt.axis([158680, 159155, -1, 15])new_ticks = np.linspace(158680,159122,10)
plt.xticks(new_ticks)plt.plot(X95,Y95,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X96,Y96,color='r',lw=1.0,ls='-',label='C2H5OH')
plt.plot(X97,Y97,color='g',lw=1.0,ls='-',label='CH3COCH3')
plt.plot(X98,Y98,color='cyan',lw=1.0,ls='-',label='CH3OCHO v18=1')
plt.plot(X99,Y99,color='b',lw=1.0,ls='-',label='CH3OCHO v=0')
plt.legend(loc='upper left')
plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(159110,13,'IRAS16293B')plt.plot([158689,158689],[7,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (158689, 3.5), xytext = (158700,4),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.plot([158963,158963],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v=0", xy = (158694,6), xytext = (158760,9),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))#plt.plot([158963,158963],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v=0", xy = (158704,9.5), xytext = (158770,12),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([158963,158963],[2.5,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3COCH3", xy = (158963, 3.5), xytext = (158980,6),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.plot([159030,159030],[2.4,15], color ='grey', linewidth=1, linestyle="--")
plt.annotate("CH3OCHO v18=1", xy = (159030,4), xytext = (159000,9),arrowprops = dict(facecolor = "y", headlength=10, headwidth =3, width =0.1))plt.show()

I17220:

import matplotlib
import matplotlib.pyplot as plt
import numpy as np#import data
#
filename = '1.txt'
X11,Y11 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X11.append(value[0])Y11.append(value[1])
filename = '1xclass_spectrum_output.dat'
X12,Y12 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X12.append(value[0])Y12.append(value[1])#
filename = '2.txt'
X21,Y21 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X21.append(value[0])Y21.append(value[1])
filename = '2xclass_spectrum_output.dat'
X22,Y22 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X22.append(value[0])Y22.append(value[1])#
filename = '3.txt'
X31,Y31 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X31.append(value[0])Y31.append(value[1])
filename = '3xclass_spectrum_output.dat'
X32,Y32 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X32.append(value[0])Y32.append(value[1])#
filename = '4.txt'
X41,Y41 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X41.append(value[0])Y41.append(value[1])
filename = '4xclass_spectrum_output.dat'
X42,Y42 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X42.append(value[0])Y42.append(value[1])#
filename = '5.txt'
X51,Y51 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X51.append(value[0])Y51.append(value[1])
filename = '5xclass_spectrum_output.dat'
X52,Y52 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X52.append(value[0])Y52.append(value[1])#
filename = '6.txt'
X61,Y61 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X61.append(value[0])Y61.append(value[1])
filename = '6xclass_spectrum_output.dat'
X62,Y62 = [],[]
with open(filename, 'r') as f:lines = f.readlines()for line in lines:value = [float(s) for s in line.split()]X62.append(value[0])Y62.append(value[1])###################################################################################################################################################plt.figure(1)
plt.axis([348898.1,350883.4, -0.5, 4])new_ticks = np.linspace(348898.1,350883.4,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X11,Y11,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X12,Y12,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
plt.text(350790,3.8,'I 17220', size=13, rotation=0.,ha="center", va="center",bbox=dict(boxstyle='square,pad=0.5', fc='grey', ec='k',lw=1 ,alpha=0.5))plt.plot([349107,349107],[0.8,3.5], color ='grey', linewidth=1, linestyle="--")
plt.text(349107,4,'CH3OH', size=10, rotation=90.,ha="center", va="top")  plt.plot([349338,349338],[2.4,3.7], color ='grey', linewidth=1, linestyle="--")
plt.text(349338,4,'CCH', size=10, rotation=90.,ha="center", va="top")plt.plot([349398,349398],[2,3.7], color ='grey', linewidth=1, linestyle="--")
plt.text(349398,4,'CCH', size=10, rotation=90.,ha="center", va="top")plt.plot([349808,349808],[0.2,3.3], color ='grey', linewidth=1, linestyle="--")
plt.text(349808,4,'CH3OCH3', size=10, rotation=90.,ha="center", va="top")plt.plot([350332,350332],[0.2,3.2], color ='grey', linewidth=1, linestyle="--")
plt.text(350332,4,'HNCO v=0', size=10, rotation=90.,ha="center", va="top")plt.plot([350687,350687],[1.8,3.5], color ='grey', linewidth=1, linestyle="--")
plt.text(350687,4,'CH3OH', size=10, rotation=90.,ha="center", va="top")#plt.savefig('1.png')
plt.show()########################################################################### figure2plt.figure(2)
plt.axis([346912.1,348897.7, -0.5, 4])new_ticks = np.linspace(346912.1,348897.7,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X21,Y21,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X22,Y22,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')
#plt.text(350790,3.8,'I 17220', size=13, rotation=0.,ha="center", va="center",bbox=dict(boxstyle='square,pad=0.5', fc='grey', ec='k',lw=1 ,alpha=0.5))plt.plot([346999,346999],[2.5,3], color ='grey', linewidth=1, linestyle="--")
plt.text(346999,4,'HC-13-O+;v=0;#1', size=10, rotation=90.,ha="center", va="top")plt.plot([347188,347188],[0.3,2.8], color ='grey', linewidth=1, linestyle="--")
plt.text(347188,4,'C-13-H3OH;v=0', size=10, rotation=90.,ha="center", va="top")plt.plot([348340,348340],[0.3,3], color ='grey', linewidth=1, linestyle="--")
plt.text(348340,4,'HNC-13;v=0', size=10, rotation=90.,ha="center", va="top")plt.plot([348386,348386],[0.1,3.5], color ='grey', linewidth=1, linestyle="--")
plt.text(348386,4,'SO2', size=10, rotation=90.,ha="center", va="top") plt.plot([348534,348534],[1.3,3.5], color ='grey', linewidth=1, linestyle="--")
plt.text(348534,4,'H2CS', size=10, rotation=90.,ha="center", va="top")  plt.show()############################################################################# 3plt.figure(3)
plt.axis([336905.2,338899.6, -0.5, 8])new_ticks = np.linspace(336905.2,338899.6,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X31,Y31,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X32,Y32,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')plt.plot([337060,337060],[5.6,8], color ='grey', linewidth=1, linestyle="--")
plt.text(337090,7,'CO-17;v=0', size=10, rotation=90.,ha="center", va="top")plt.plot([337138,337138],[0.5,7], color ='grey', linewidth=1, linestyle="--")
plt.text(337138,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([337396,337396],[2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(337396,8,'CS-34', size=10, rotation=90.,ha="center", va="top")plt.plot([338080,338080],[1,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338080,8,'H2CS', size=10, rotation=90.,ha="center", va="top")plt.plot([338122,338122],[1,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338122,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([338308,338308],[0.5,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338308,8,'SO2', size=10, rotation=90.,ha="center", va="top")plt.plot([338345,338345],[3,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338345,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([338583,338583],[1,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338583,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([338613,338613],[2.7,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338613,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([338640,338640],[1,7], color ='grey', linewidth=1, linestyle="--")
plt.text(338640,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.show()################################################################################################### 4plt.figure(4)
plt.axis([334911.0,336904.5, -0.5, 8])new_ticks = np.linspace(334911.0,336904.5,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X41,Y41,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X42,Y42,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')plt.plot([335097,335097],[0.2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(335097,8,'HDCO', size=10, rotation=90.,ha="center", va="top")plt.plot([335133,335133],[0.2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(335133,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([335582,335582],[2.3,7], color ='grey', linewidth=1, linestyle="--")
plt.text(335582,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([336520,336520],[0.5,7], color ='grey', linewidth=1, linestyle="--")
plt.text(336520,8,'HCCCN', size=10, rotation=90.,ha="center", va="top")plt.plot([336863,336863],[1.2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(336863,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.show()##################################################################################################### 5plt.figure(5)
plt.axis([459062.0,461533.3, -0.5, 8])new_ticks = np.linspace(459062.0,461533.3,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X51,Y51,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X52,Y52,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')plt.plot([460875,460875],[1.2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(460875,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([461065,461065],[0,8], color ='grey', linewidth=1, linestyle="--")
plt.text(461100,8,'CO', size=10, rotation=90.,ha="center", va="top")plt.show()########################################################################################### 6plt.figure(6)
plt.axis([460552.6,463028.7, -0.5, 8])new_ticks = np.linspace(460552.6,463028.7,10)
plt.xticks(new_ticks)matplotlib.rcParams['xtick.direction'] = 'in'
matplotlib.rcParams['ytick.direction'] = 'in'plt.plot(X61,Y61,color='k',lw=1.0,ls='-',label='DATA')
plt.plot(X62,Y62,color='r',lw=1.0,ls='-',label='FIT')
plt.legend(loc='upper left')plt.xlabel('Freq(MHZ)')
plt.ylabel('T(K)')plt.plot([460875,460875],[1.2,7], color ='grey', linewidth=1, linestyle="--")
plt.text(460875,8,'CH3OH', size=10, rotation=90.,ha="center", va="top")plt.plot([461064,461064],[0,8], color ='grey', linewidth=1, linestyle="--")
plt.text(461100,8,'CO', size=10, rotation=90.,ha="center", va="top")plt.plot([461757,461757],[0.5,7.5], color ='grey', linewidth=1, linestyle="--")
plt.text(461756,8,'SO', size=10, rotation=90.,ha="center", va="top")plt.plot([461908,461908],[0.5,7.5], color ='grey', linewidth=1, linestyle="--")
plt.text(461908,8,'OCS', size=10, rotation=90.,ha="center", va="top")plt.show()

python 导入数据及作图相关推荐

  1. python画图代码的输入数据可以取出来_python 导入数据及作图的实现

    我们经常需要导入数据,按列提取 XY作图 方法一. filename='/home/res/user/csluo/test.txt' #将文件名赋值为变量 X,Y,Z=[ ],[ ],[ ] #给三个 ...

  2. Python导入数据

    Python导入数据的方法: 1)导入外部数据 2)导入模块内部的数据集 1)导入外部数据--利用pandas import pandas as pd data1 = pd.read_excel('a ...

  3. python导入数据画折线图_Python读取Excel表格,并同时画折线图和柱状图的方法

    今日给大家分享一个Python读取Excel表格,同时采用表格中的数值画图柱状图和折线图,这里只需要几行代码便可以实. 首先我们需要安装一个Excel操作的库xlrd,这个很简单,在安装Python后 ...

  4. python导入数据画直方图加正态曲线_Python数据分析入门 - 正态分布

    import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline #matplotli ...

  5. python课程丶优达学城_《数据分析入门—优达学城》学习python导入数据并改正数据类型...

    利用python学习数据分析之数据导入 本文为Udacity数据分析入门课程学习笔记,数据源为课程附件资料3个csv表格记录Udacity的学员注册信息,学员每日参与行为数据,项目记录,课程主要目标学 ...

  6. python导入数据画柱状图代码_在Linux下使用Python的matplotlib绘制数据图的教程

    如果你想要在Linxu中获得一个高效.自动化.高质量的科学画图的解决方案,应该考虑尝试下matplotlib库.Matplotlib是基于python的开源科学测绘包,基于python软件基金会许可证 ...

  7. python导入数据画直方图加正态曲线_使用Python绘制直方图和正态分布曲线

    原博文 2020-03-20 22:01 − 本文主要介绍两个内容: 如何使用记事本生成包含某一数据集的CSV文件: 如何使用Python绘制给定数据集的直方图和正态分布曲线. 1. 使用记事本创建C ...

  8. python导入数据聚类分析实例_聚类分析实战解析与总结 - 数据分析

    聚类分析是没有给定划分类别的情况下,根据样本相似度进行样本分组的一种方法,是一种非监督的学习算法.聚类的输入是一组未被标记的样本,聚类根据数据自身的距离或相似度划分为若干组,划分的原则是组内距离最小化 ...

  9. python 导入数据对不齐_NumPy:使用loadtxt或genfromtxt读取参差不齐的结构

    据我所知,你确实需要一个定制的循环"分铸".在 事实上,NumPy可以读取像您这样的嵌套结构,但它们必须具有固定的形状,如Innumpy.loadtxt('data.txt', d ...

最新文章

  1. hdu4940 有上下界的无源可行流判断
  2. 1.2 正交化-深度学习第三课《结构化机器学习项目》-Stanford吴恩达教授
  3. Machine Learning week 7 quiz: Support Vector Machines
  4. idea怎么把代码放到git_在IDEA中如何初始化Git,把项目推送到Git上
  5. [jQuery] 说说看jQuery的选择器有哪些?
  6. 广州的11个辖区_重庆前三季度GDP反超广州,这对两城到底意味着什么?
  7. Android系统(244)---Zygote进程的启动流程
  8. imewlconverter 制作Rime词库
  9. 利用vue.js实现一个砍价小程序
  10. 部分更新没有安装 KB4535102
  11. 企业IT管理员IE11升级指南【4】—— IE企业模式介绍
  12. Win11任务栏修改方法(更新中)
  13. 《LeetCode刷题》954. 二倍数对数组(java篇)
  14. 尺取法 — 详解 + 例题模板(全)
  15. access设计视图打不开_15、ACCESS总计查询(分组查询)设计(ACCESS图解操作系列)...
  16. 腾讯云 视频通话SDK 第一个坑 域名要开https
  17. python的擅长领域
  18. C# winform 控件随窗体放大缩小
  19. 给出一个大于或等于3的正整数,判断它是不是一个素数
  20. 计算机桌面变成立体,win7系统将桌面变成立体桌面的两种方法

热门文章

  1. IP地址、子网掩码、网络号、主机号、网络地址、主机地址以及ip段详解
  2. 关于Linux的历史
  3. VOT 2017挑战赛——目标追踪相关分享
  4. 科技创新+工匠精神:“娃界小米”全球销量第一的奥秘
  5. 信息学竞赛中的数学知识 --- 容斥原理
  6. 烟台大学 计114-3.4 班学生的博客地址
  7. 信号与系统 chapter14 卷积积分的应用
  8. CSS样式 – 背景background
  9. Mac Ideal快捷键
  10. 运营商强制用户升级光纤:非免费 否则停网