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: ...@@ -412,7 +412,7 @@ class CCod:
# plot # plot
# first plot: plot distance between 2 halos on whole simulation # first plot: plot distance between 2 halos on whole simulation
plt.subplot(211) 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.axvline(merging_time,color='g',dashes=(10,3),label="merging")
plt.title('Distance between 2 Halos : '+simname) plt.title('Distance between 2 Halos : '+simname)
plt.xlabel('Gyears') plt.xlabel('Gyears')
...@@ -425,13 +425,13 @@ class CCod: ...@@ -425,13 +425,13 @@ class CCod:
#plt.title('Distance between 2 Halos') #plt.title('Distance between 2 Halos')
plt.xlabel('Gyears') plt.xlabel('Gyears')
plt.ylabel('Kpc') plt.ylabel('Kpc')
select_t=data1[time1_sort][:,0]>merging_time select_t=(data1[time1_sort][:,0]>merging_time)
plt.plot(data1[select_t][:,0],distance[select_t],'b.') plt.plot(data1[time1_sort[select_t]][:,0],distance[time1_sort[select_t]],'b')
plt.axvline(merging_time,color='g',dashes=(10,3)) plt.axvline(merging_time,color='g',dashes=(10,3))
ax = plt.axis() # get axis coordinates ax = plt.axis() # get axis coordinates
plt.text(merging_time+0.01,(ax[3]-ax[2])/2,"%.3f"%(merging_time)) # print merging time plt.text(merging_time+0.01,(ax[3]-ax[2])/2,"%.3f"%(merging_time)) # print merging time
plt.tight_layout() plt.tight_layout()
#plt.show()
if txtfile is not None: if txtfile is not None:
m_txt=outdir+"/"+txtfile 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