Skip to content
Snippets Groups Projects
Commit 8d9fbb40 authored by Armin Damon Riess's avatar Armin Damon Riess
Browse files

changed plot to loglog, added Poissonian error bars, but probably incorrect

parent 4e261983
No related branches found
No related tags found
No related merge requests found
plots/densityprofile.png

65.6 KiB | W: | H:

plots/densityprofile.png

92.2 KiB | W: | H:

plots/densityprofile.png
plots/densityprofile.png
plots/densityprofile.png
plots/densityprofile.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -10,7 +10,7 @@ z = data[:,4]
m = data[:,1]
M = np.sum(m)
print(x)
print("Number of particles:",len(m))
maxr = 256
dr = 4
......@@ -34,13 +34,17 @@ rho /= 4*np.pi*r**2*dr
# rhoHernquist /= np.sum(rhoHernquist)
# rho /= np.sum(rho)
print(rho.shape)
print("Number of bins:",len(rho))
plt.plot(np.log(r), np.log(rhoHernquist), 'r.-', label='Hernquist Density Profile')
plt.plot(np.log(r), np.log(rho), 'b.-', label='Density Profile')
# plot poissonian error bars
plt.errorbar(r, rhoHernquist, yerr=np.sqrt(rhoHernquist), fmt='grey', label='Hernquist with Poisson error')
# plot Hernquist profile
plt.loglog(r, rhoHernquist, 'r.-', label='Hernquist Density Profile')
# plot density profile of data
plt.loglog(r, rho, 'b.-', label='Density Profile from data')
plt.xlabel('log(r)')
plt.ylabel('log(rho)')
plt.xlabel('Radius r')
plt.ylabel('Density rho(r)')
plt.legend()
plt.savefig('densityprofile.png', dpi=200)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment