User: knarf Date: 2011/10/16 11:58 PM
Added: /examples/collapse/ plot_defaults.py, radii.pdf, radii.py, rho_max.pdf, rho_max.py
Log: matplotlib plots
Directory Changes:
Directory: /svn:executable/ ===========================
+ * Directory: /svn:mime-type/ ==========================
+ application/pdf Directory: /svn:special/ ========================
+ *
File Changes:
Directory: /examples/collapse/ ==============================
File [added]: plot_defaults.py Delta lines: +1 -0 =================================================================== --- examples/collapse/plot_defaults.py (rev 0) +++ examples/collapse/plot_defaults.py 2011-10-17 04:58:40 UTC (rev 149) @@ -0,0 +1 @@ +link ../../plot_defaults.py \ No newline at end of file
Property changes on: examples/collapse/plot_defaults.py ___________________________________________________________________
File [added]: radii.pdf Delta lines: +0 -0 =================================================================== (Binary files differ)
Property changes on: examples/collapse/radii.pdf ___________________________________________________________________
File [added]: radii.py Delta lines: +50 -0 =================================================================== --- examples/collapse/radii.py (rev 0) +++ examples/collapse/radii.py 2011-10-17 04:58:40 UTC (rev 149) @@ -0,0 +1,50 @@ +#!/usr/bin/python + +# Plot evolution of central density +from plot_defaults import * + +# stuff +xlim = (0,10) +ylim = (-140,-100) + +# load data +Fx, Fy = np.genfromtxt("tov_3/star_edge.asc", comments="#", usecols=(1,2), unpack=True, invalid_raise=False) +Bx, By = np.genfromtxt("tov_3/BH_diagnostics.ah1.gp", comments="#", usecols=(1,27), unpack=True) + +# Plot basics +fig = plt.figure(figsize=(6, 3)) +fig.subplots_adjust(top=0.85, bottom=0.16, left=0.11,right=0.97) +ax = fig.add_subplot(1,1,1) + +# plot +ax.plot(Fx, Fy/(2*1.63), linestyle='-', color='black', label='outer star edge') +ax.plot(Bx, By/(2*1.63), linestyle='--', color='blue', label='apparent horizon radius') + +# plot properties +#ax.set_xlim(xlim) +#ax.set_ylim(ylim) + +#plt.title('PSD', fontsize=fontsize) + +ax.set_xlabel(r't [M]') +ax.xaxis.set_major_locator(mticker.MaxNLocator(7)) +ax.xaxis.set_minor_locator(mticker.MaxNLocator(14)) +ax.xaxis.grid(False) +ax2 = ax.twiny() +ax2.set_xlabel(r't [ms]') +ax2.set_xlim((ax.get_xlim()[0]/M_to_ms, ax.get_xlim()[1]/M_to_ms)) +ax2.xaxis.set_major_locator(mticker.MaxNLocator(7)) +ax2.xaxis.set_minor_locator(mticker.MaxNLocator(14)) +ax.set_ylabel(r'$R/R_G$') +ax.yaxis.set_major_locator(mticker.MaxNLocator(5)) +ax.yaxis.set_minor_locator(mticker.MaxNLocator(10)) +ax.yaxis.grid(False) +set_tick_sizes(ax, 8, 4) + +handles, labels = ax.get_legend_handles_labels() +ax.ticklabel_format(useOffset=False) +ax.legend(handles, labels, loc='best') + +#plt.show() +plt.savefig('radii.pdf') +
Property changes on: examples/collapse/radii.py ___________________________________________________________________
File [added]: rho_max.pdf Delta lines: +0 -0 =================================================================== (Binary files differ)
Property changes on: examples/collapse/rho_max.pdf ___________________________________________________________________
File [added]: rho_max.py Delta lines: +44 -0 =================================================================== --- examples/collapse/rho_max.py (rev 0) +++ examples/collapse/rho_max.py 2011-10-17 04:58:40 UTC (rev 149) @@ -0,0 +1,44 @@ +#!/usr/bin/python + +# Plot evolution of central density +from plot_defaults import * + +# stuff +xlim = (0,10) +ylim = (-140,-100) + +# load data +Fx, Fy = np.loadtxt("tov_3/rho.maximum.asc", comments="#", usecols=(1,2), unpack=True) + +# Plot basics +fig = plt.figure(figsize=(6, 3)) +fig.subplots_adjust(top=0.85, bottom=0.16, left=0.11,right=0.97) +ax = fig.add_subplot(1,1,1) + +# plot +ax.plot(Fx, Fy*M_to_density / 1e3 / 1e15, linestyle='-', color='black') + +# plot properties +#ax.set_xlim(xlim) +#ax.set_ylim(ylim) + +#plt.title('PSD', fontsize=fontsize) + +ax.set_xlabel(r't [M]') +ax.xaxis.set_major_locator(mticker.MaxNLocator(7)) +ax.xaxis.set_minor_locator(mticker.MaxNLocator(14)) +ax.xaxis.grid(False) +ax2 = ax.twiny() +ax2.set_xlabel(r't [ms]') +ax2.set_xlim((ax.get_xlim()[0]/M_to_ms, ax.get_xlim()[1]/M_to_ms)) +ax2.xaxis.set_major_locator(mticker.MaxNLocator(7)) +ax2.xaxis.set_minor_locator(mticker.MaxNLocator(14)) +ax.set_ylabel(r'$\varrho/10^{15}\mathrm{g}/\mathrm{cm}^3$') +ax.yaxis.set_major_locator(mticker.MaxNLocator(5)) +ax.yaxis.set_minor_locator(mticker.MaxNLocator(10)) +ax.yaxis.grid(False) +set_tick_sizes(ax, 8, 4) + +#plt.show() +plt.savefig('rho_max.pdf') +
Property changes on: examples/collapse/rho_max.py ___________________________________________________________________