In [ ]:
from __future__ import print_function
import yt
import numpy as np
1. Load the `"virgo_novisc.0054.gdf"` dataset from the `"data"` directory.
In [ ]:
ds = yt.load("../data/virgo_novisc.0054.gdf")
2. Create a `SlicePlot` of temperature along the y-axis, with a width of 0.4 Mpc. Change the colormap to "algae". Annotate the magnetic field vectors.
In [ ]:
slc = yt.SlicePlot(ds, "y", ["temperature"], width=(0.4, "Mpc"))
slc.set_cmap("temperature", "algae")
slc.annotate_magnetic_field()
3. What happens if you supply a vector, say `[0.1, -0.3, 0.4]`, to the second argument of `SlicePlot`? Try it.
In [ ]:
slc = yt.SlicePlot(ds, [0.1, -0.3, 0.4], ["temperature"], width=(0.4, "Mpc"))
slc.set_cmap("temperature", "algae")
4. Now make a `ProjectionPlot` of the `"velocity_x"` field, weighted by the `"density"` field, along the x-axis. Use the `set_log` method to make the plot have linear scaling, and change the units to km/s.
In [ ]:
prj = yt.ProjectionPlot(ds, 'x', ["velocity_x"], weight_field="density", width=(0.4, "Mpc"))
prj.set_log("velocity_x", False)
prj.set_unit("velocity_x", "km/s")