summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2013-05-15 09:46:43 +0200
committerVolker Hoffmann <volker@cheleb.net>2013-05-15 09:46:43 +0200
commit9ef138478b2db8547f82b7417d2f5194c09924c6 (patch)
treef729b9a000e7f977156dcdc7998eaa07752c478c
parentef3f3c4d53cd26c281e0b70942bfa66e77485261 (diff)
cleaned up a bit
-rw-r--r--plot_stats.py38
1 files changed, 17 insertions, 21 deletions
diff --git a/plot_stats.py b/plot_stats.py
index a74bcf0..8c937a7 100644
--- a/plot_stats.py
+++ b/plot_stats.py
@@ -75,45 +75,41 @@ delta_mass_total = np.diff(mass_total) / np.diff(time)
# Make Plots
fig = plt.figure(figsize=(16.0, 6.0))
-ax = fig.add_subplot(1,2,1)
-ax2 = ax.twiny()
+ax1 = fig.add_subplot(1,2,1)
+ax2 = ax1.twiny()
ax3 = fig.add_subplot(1,2,2)
ax4 = ax3.twiny()
if args.disk:
- ax.plot(time/2./pi, mass_disk, 'bs-', label='Disk Mass')
+ ax1.plot(time/2./pi, mass_disk, 'bs-', label='Disk Mass')
ax3.plot(time[1::]/2./pi, delta_mass_disk, 'bs-', label='d(Disk Mass)/dt')
if args.halo:
- ax.plot(time/2./pi, mass_halo, 'rs-', label='Halo Mass')
+ ax1.plot(time/2./pi, mass_halo, 'rs-', label='Halo Mass')
ax3.plot(time[1::]/2./pi, delta_mass_halo, 'rs-', label='d(Halo Mass)/dt')
if args.box:
- ax.plot(time/2./pi, mass_total, 'gs-', label='Box Mass')
+ ax1.plot(time/2./pi, mass_total, 'gs-', label='Box Mass')
ax3.plot(time[1::]/2./pi, delta_mass_total, 'gs-', label='d(Box Mass)/dt')
if args.lost_halo:
- ax.plot(time/2./pi, mass_total_lost_to_halo, 'ms-', \
- label='Total Mass Lost to Halo')
+ ax1.plot(time/2./pi, mass_total_lost_to_halo, 'ms-', \
+ label='Total Mass Lost to Halo')
ax3.plot(time[1::]/2./pi, delta_mass_total_lost_to_halo, 'ms-', \
label='d(Total Mass Lost to Halo)/dt')
if args.lost_star:
- ax.plot(time/2./pi, mass_total_lost_to_star, 'ks-', \
- label='Total Mass Lost to Star')
+ ax1.plot(time/2./pi, mass_total_lost_to_star, 'ks-', \
+ label='Total Mass Lost to Star')
ax3.plot(time[1::]/2./pi, 2.*pi*delta_mass_total_lost_to_star, 'ks-', \
label='d(Total Mass Lost to Star)/dt')
fig.suptitle('Mass Budget')
ax2.plot(time, np.ones_like(time))
-ax2.cla()
-ax2.set_xlabel('Time [code]')
+ax2.cla(); ax2.set_xlabel('Time [code]')
ax4.plot(time, np.ones_like(time))
-ax4.cla()
-ax4.set_xlabel('Time [code]')
-ax.grid(); ax.set_yscale('log')
+ax4.cla(); ax4.set_xlabel('Time [code]')
+ax1.grid(); ax1.set_yscale('log')
ax3.grid(); ax3.set_yscale('log')
-ax2.set_ylim(ax.get_ylim())
-ax2.set_yscale(ax.get_yscale())
-ax4.set_ylim(ax3.get_ylim())
-ax4.set_yscale(ax3.get_yscale())
-ax.set_xlabel('Time [yr]')
-ax.set_ylabel('Mass [Mstar]')
-ax.legend(loc='best')
+ax2.set_ylim(ax1.get_ylim()); ax2.set_yscale(ax1.get_yscale())
+ax4.set_ylim(ax3.get_ylim()); ax4.set_yscale(ax3.get_yscale())
+ax1.set_xlabel('Time [yr]')
+ax1.set_ylabel('Mass [Mstar]')
+ax1.legend(loc='best')
ax3.set_xlabel('Time [yr]')
ax3.set_ylabel('d(Mass)/dt [Mstar/yr]')
ax3.legend(loc='best')