scatter

Chart2D.scatter(x, y, color='b', size=10, style='o', label='')

Add a scatter plot to this chart.

Parameters
xarray_like

X coordinates of the points to draw.

yarray_like

Y coordinates of the points to draw.

colorcolor, optional

Color of the points drawn in this plot. Any color parsable by pyvista.parse_color is allowed. Defaults to "b".

sizefloat, optional

Size of the point markers drawn in this plot. Defaults to 10.

stylestr, optional

Style of the point markers drawn in this plot. See ScatterPlot2D.MARKER_STYLES for a list of allowed marker styles. Defaults to "o".

labelstr, optional

Label of this plot, as shown in the chart’s legend. Defaults to "".

Returns
plotting.charts.ScatterPlot2D

The created scatter plot.

Examples

Generate a scatter plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.scatter([0, 1, 2], [2, 1, 3])
>>> chart.show()
../../../../_images/pyvista-Chart2D-scatter-1_00_00.png