Skip to content

Commit

Permalink
update the plotting script for bubble_convergence (#2947)
Browse files Browse the repository at this point in the history
this now gives more reasonable defaults
  • Loading branch information
zingale authored Aug 28, 2024
1 parent a21499b commit b3696ad
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions Exec/reacting_tests/bubble_convergence/analysis/slice_multi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

import matplotlib
matplotlib.use('agg')

import os
import sys
import yt
Expand All @@ -26,35 +29,37 @@
fig = plt.figure()
fig.set_size_inches(12.0, 9.0)

grid = ImageGrid(fig, 111, nrows_ncols=(2, 2), axes_pad=0.75, cbar_pad="2%",
grid = ImageGrid(fig, 111, nrows_ncols=(2, 2),
axes_pad=0.75, cbar_pad="2%",
label_mode="L", cbar_mode="each")


fields = ["Temp", "magvel", "X(C12)", "rho_enuc"]
fields = ["Temp", "magvel", "X(C12)", "enuc"]

for i, f in enumerate(fields):

sp = yt.SlicePlot(ds, "z", f, center=[xctr, yctr, 0.0], width=[L_x, L_y, 0.0], fontsize="12")
sp = yt.SlicePlot(ds, "z", f, center=[xctr, yctr, 0.0*cm],
width=[L_x, L_y, 0.0*cm], fontsize="12")
sp.set_buff_size((2000,2000))

if f == "X(C12)":
sp.set_log(f, True)
sp.set_cmap(f, "plasma")
sp.set_zlim(f, 1.e-8, 2.e-4)
sp.set_cmap(f, "magma")
sp.set_zlim(f, 1.e-8, 1.e-4)

elif f == "magvel":
sp.set_log(f, False)
#sp.set_zlim(f, 1.e-3, 2.5e-2)
sp.set_cmap(f, "magma")
sp.set_cmap(f, "cividis")

elif f == "Temp":
sp.set_log(f, False)
#sp.set_zlim(f, 1.e-3, 2.5e-2)

elif f == "rho_enuc":
sp.set_log(f, True)
sp.set_zlim(f, 5.e7, 2.e8)

elif f == "enuc":
sp.set_log(f, True, linthresh=1.e11)
sp.set_zlim(f, 1.e11, 1.e14)
sp.set_cmap(f, "plasma")
#sp.set_zlim(f, 1.e-3, 2.5e-2)

sp.set_axes_unit("cm")

Expand All @@ -71,5 +76,4 @@

fig.set_size_inches(8.0, 8.0)
plt.tight_layout()
plt.savefig("{}_slice.pdf".format(os.path.basename(plotfile)))

plt.savefig("{}_slice.png".format(os.path.basename(plotfile)))

0 comments on commit b3696ad

Please sign in to comment.