From 785f596e7f448fd567396ac02750c825a8c82b02 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sat, 27 Sep 2014 23:10:40 +0000
Subject: [PATCH] Now plotting the x coordinate of particles rather than their
 ID on the x-axis.

---
 examples/plot_sorted.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/examples/plot_sorted.py b/examples/plot_sorted.py
index 73b92b8..566ec8e 100644
--- a/examples/plot_sorted.py
+++ b/examples/plot_sorted.py
@@ -39,6 +39,8 @@ print "Plotting..."
 # Read Quickshed accelerations
 data=loadtxt("interaction_dump.dat")
 id = data[:,0]
+posx = data[:,2]
+
 accx_u=data[:,5]
 accy_u=data[:,6]
 accz_u=data[:,7]
@@ -75,29 +77,29 @@ figure(frameon=True)
 
 subplot(311, title="Acceleration along X")
 #plot(id[abs(errx_s) > 0.001], e_errx_s , 'rx')
-plot(id, e_errx_s , 'rx')
+plot(posx, e_errx_s , 'rx')
 #text(id[-1], 0.18, "B-H: $%5.3f\\pm%5.3f$\n QuickShed: $%5.3f\\pm%5.3f$"%(meanx_bh, stdx_bh, meanx_new, stdx_new), backgroundcolor="w", va="top", ha="right" )
 ylim(-0.2, 0.2)
-xlim(0, size(id)-1)
+#xlim(0, size(id)-1)
 grid()
 
 subplot(312, title="Acceleration along Y")
 #plot(id[abs(erry_s) > 0.001], e_erry_s , 'rx')
-plot(id, e_erry_s , 'rx')
+plot(posx, e_erry_s , 'rx')
 #text(id[-1], 0.18, "B-H: $%5.3f\\pm%5.3f$\n QuickShed: $%5.3f\\pm%5.3f$"%(meany_bh, stdy_bh, meany_new, stdy_new), backgroundcolor="w", va="top", ha="right" )
 ylim(-0.2, 0.2)
-xlim(0, size(id)-1)
+#xlim(0, size(id)-1)
 
 grid()
 
 subplot(313, title="Acceleration along Z")
 #plot(id[abs(errz_s) > 0.001], e_errz_s , 'rx', label="Sorted")
-plot(id, e_errz_s , 'rx', label="Sorted")
+plot(posx, e_errz_s , 'rx', label="Sorted")
 #text(id[-1], 0.18, "B-H: $%5.3f\\pm%5.3f$\n QuickShed: $%5.3f\\pm%5.3f$"%(meanz_bh, stdz_bh, meanz_new, stdz_new), backgroundcolor="w", va="top", ha="right" )
 legend(loc="upper right")
 
 ylim(-0.2, 0.2)
-xlim(0, size(id)-1)
+#xlim(0, size(id)-1)
 grid()
 
 savefig("accelerations.png")
-- 
GitLab