yt.raven.PlotCollectionInteractive.add_scatter_source

PlotCollectionInteractive.add_scatter_source(*args, **kwargs)

Given a data source, make a scatter plot from that data source.

This is a very simple plot: you give it an instance of AMRData, two field names, and it will plot them on an axis

Parameters :

data_source : yt.lagos.AMRData

This will be the data source from which field values will be obtained.

fields : tuple of strings

The first of these will be the x-field, and the second the y-field.

id : int, optional

If specified, this will be the “semi-unique id” of the resultant plot. This should not be set.

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.

plot_options : dict

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

Returns :

plot : yt.raven.ScatterPlot

The plot that has been added to the PlotCollection.

Notes

This is a simpler way of making a phase plot, but note that because pixels are deposited in order, the color may be a biased sample.

Examples

>>> reg = pf.h.region([0.1, 0.2, 0.3], [0.0, 0.1, 0.2],
                      [0.2, 0.3, 0.4])
>>> pc.add_scatter_plot(reg, ["Density", "Temperature"],
>>>                     plot_options = {'color':'b'})

This Page