"""
This is a simple recipe to show how to open a dataset and then plot a radial
profile showing mass-weighted average Density inside a sphere.  For more
information, see :ref:`methods-profiles`.
"""
from yt.mods import * # set up our namespace

fn = "RedshiftOutput0005" # parameter file to load

pf = load(fn) # load data
pc = PlotCollection(pf) # defaults to center at most dense point
pc.add_profile_sphere(10.0, "mpc", # how many of which unit at pc.center
    ["RadiusMpc", "Density"], weight="CellMassMsun", # x, y, weight
     x_bounds = (1e-3, 10.0))  # cut out zero-radius and tiny-radius cells
    # But ... weight defaults to CellMassMsun, so we're being redundant here!
pc.save(fn) # save all plots
