Scatter#

class data_morph.shapes.points.scatter.Scatter(dataset: Dataset)[source]#

Bases: PointCollection

Class for the scatter shape: a cloud of randomly-scattered points.

../_images/data_morph-shapes-points-scatter-Scatter-1.png

This shape is generated using the panda dataset.#

Parameters:

dataset (Dataset) – The starting dataset to morph into other shapes.

distance(x: Number, y: Number) int[source]#

No-op that allows returns 0 so that all perturbations are accepted.

Parameters:
  • x (int or float) – Coordinates of a point in 2D space.

  • y (int or float) – Coordinates of a point in 2D space.

Returns:

Always returns 0 to allow for scattering of the points.

Return type:

int

classmethod get_name() str#

Get the name of the shape.

Returns:

The name of the shape.

Return type:

str

name: str | None = None#

The display name for the shape, if the lowercased class name is not desired.

plot(ax: Axes | None = None) Axes#

Plot the shape.

Parameters:

ax (matplotlib.axes.Axes, optional) – An optional Axes object to plot on.

Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes

points#

An array of (x, y) values representing an arrangement of points.

Type:

numpy.ndarray