yt.raven.PlotCollection.add_particles

PlotCollection.add_particles(axis, width, p_size=1.0, col='k', stride=1.0, data_source=None, figure=None, axes=None)

Create a plot of a thick slab of particles.

This function will generate a yt.lagos.AMRRegionBase from the given parameters, and all particles which are within that region will be plotted.

Parameters :

axis : int

The axis along which to create the thick slab. Can be 0, 1, or 2 for x, y, z.

width : float

The width of the thick slab, in code units, from which particles will be plotted.

p_size : float, optional

The size of the points to be used to represent the particles, in pixels.

col : color, optional

Specified in matplotlib color specifications, the color that particles should be.

stride : float, optional

The stride through the particles to plot. Used to plot every fifth, every tenth, etc. Note that the sorted order of particles may result in a biased selection of particles.

data_source : yt.lagos.AMRData, optional

If specified, this will be the data source used for obtaining particles.

figure : matplotlib.figure.Figure, optional

The figure onto which the axes will be placed. Typically not used unless axes is also specified.

axes : matplotlib.axes.Axes, optional

The axes object which will be used to create the image plot. Typically used for things like multiplots and the like.

Returns :

plot : yt.raven.ParticlePlot

The plot that has been added to the PlotCollection.

Notes

This plot type can be very expensive, and does not necessarily produce the best visual results. Plotting a large number of particles can be very tricky, and often it’s much better to instead use a slice or a (thin) projection of deposited density, like particle_density_pyx.

Examples

>>> pf = load("RD0005-mine/RedshiftOutput0005")
>>> pc = PlotCollection(pf, [0.5, 0.5, 0.5])
>>> p = pc.add_particles(0, 1.0)

Previous topic

yt.raven.PlotCollection.add_ortho_ray

Next topic

yt.raven.PlotCollection.add_phase_object

This Page