yt.raven.PlotCollection.add_ray

PlotCollection.add_ray(start_point, end_point, field, figure=None, axes=None, field_parameters=None, plot_options=None)

Create a ray between two points, from that a line plot, and add it to the current collection.

This function will generate a yt.lagos.AMRRayBase from the given parameters. This ray then gets passed to a yt.raven.LineQueryPLot, and the resultant plot is added to the current collection. Various parameters allow control of the way the line plot is displayed, as well as how the ray is generated.

Parameters :

start_point : array_like

The starting point of the ray.

end_point : array_like

The ending point of the ray.

field : string

The initial field to slice and display.

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.

field_parameters : dict, optional

This set of parameters will be passed to the slice upon creation, which can be used for passing variables to derived fields.

plot_options : dict

These options will be given to matplotlib.axes.Axes.plot

Returns :

plot : yt.raven.LineQueryPlot

The plot that has been added to the PlotCollection.

See also

yt.lagos.AMRRayBase
This is the type created by this function and passed to the plot created here.

Examples

This will cast a ray from (0.1, 0.2, 0.3) to (0.9, 0.7, 0.4) and plot it.

>>> pf = load("RD0005-mine/RedshiftOutput0005")
>>> pc = PlotCollection(pf, [0.5, 0.5, 0.5])
>>> p = pc.add_ray((0.1, 0.2, 0.3), (0.9, 0.7, 0.4), "Density")

Previous topic

yt.raven.PlotCollection.add_projection

Next topic

yt.raven.PlotCollection.add_scatter_source

This Page