Commit c390ae61 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

fix a sort bug issue when plotting

parent 58a9dd51
......@@ -412,7 +412,7 @@ class CCod:
# plot
# first plot: plot distance between 2 halos on whole simulation
plt.subplot(211)
plt.plot(data1[time1_sort][:,0],distance[time1_sort],'b.')
plt.plot(data1[time1_sort][:,0],distance[time1_sort],'b')
plt.axvline(merging_time,color='g',dashes=(10,3),label="merging")
plt.title('Distance between 2 Halos : '+simname)
plt.xlabel('Gyears')
......@@ -425,13 +425,13 @@ class CCod:
#plt.title('Distance between 2 Halos')
plt.xlabel('Gyears')
plt.ylabel('Kpc')
select_t=data1[time1_sort][:,0]>merging_time
plt.plot(data1[select_t][:,0],distance[select_t],'b.')
select_t=(data1[time1_sort][:,0]>merging_time)
plt.plot(data1[time1_sort[select_t]][:,0],distance[time1_sort[select_t]],'b')
plt.axvline(merging_time,color='g',dashes=(10,3))
ax = plt.axis() # get axis coordinates
plt.text(merging_time+0.01,(ax[3]-ax[2])/2,"%.3f"%(merging_time)) # print merging time
plt.tight_layout()
#plt.show()
if txtfile is not None:
m_txt=outdir+"/"+txtfile
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment