import yt12# Load the dataset.3ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")45# Create a slice plot for the dataset. With no additional arguments,6# the width will be the size of the domain and the center will be the7# center of the simulation box8slc = yt.SlicePlot(ds, "z", ("gas", "density"))910# Create a list of a couple of widths and units.11# (N.B. Mpc (megaparsec) != mpc (milliparsec)12widths = [(1, "Mpc"), (15, "kpc")]1314# Loop through the list of widths and units.15for width, unit in widths:16# Set the width.17slc.set_width(width, unit)1819# Write out the image with a unique name.20slc.save("%s_%010d_%s" % (ds, width, unit))2122zoomFactors = [2, 4, 5]2324# recreate the original slice25slc = yt.SlicePlot(ds, "z", ("gas", "density"))2627for zoomFactor in zoomFactors:28# zoom in29slc.zoom(zoomFactor)3031# Write out the image with a unique name.32slc.save("%s_%i" % (ds, zoomFactor))333435