画像のようにグラフの外側はできるのですが、点がプロットされません。
0890009 LMC V0009 044117.1 -672546. DCEP 15.5 16.5 P36452.98 3.52184 18 023016 I HV12711
こちらがevs_cat.datの1行目となります。これが3016行目まであります。
python
1import math 2import matplotlib.pyplot as plt 3ld = open("evs_cat.dat") 4lines = ld.readlines() 5ld.close() 6x = [] 7y = [] 8for line in lines: 9 pc=float(line[78:90]) 10 z=math.log10(pc) 11 galaxyid = line[1:3] 12 if galaxyid == "089": 13 vmax = line[48:52] 14 x.append(z) 15 y.append(vmax) 16plt.xlim(-0.5,4.5) 17plt.ylim(30,-2) 18plt.scatter(x,y,color = 'blue',s=1) 19plt.show()
あなたの回答
tips
プレビュー