"""
This is a simple recipe to show how to open a dataset, plot a projection
through it, and add particles on top.  For more information see
:ref:`callbacks`.
"""
from yt.mods import * # set up our namespace

fn = "RedshiftOutput0005" # parameter file to load

pf = load(fn) # load data
pc = PlotCollection(pf, center=[0.5,0.5,0.5]) # defaults to center at most dense point
p = pc.add_projection("Density", 0) # 0 = x-axis
# "nparticles" is slightly more efficient than "particles"
p.modify["nparticles"](1.0) # 1.0 is the 'width' we want for our slab of
                            # particles -- this governs the allowable locations
                            # of particles that show up on the image
                            # NOTE: we can also supply a *ptype* to cut based
                            # on a given (integer) particle type
pc.set_width(1.0, '1') # change width of our plot to the full domain
pc.save(fn) # save all plots
