Scatter#

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

Bases: PointCollection

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

../_images/data_morph-shapes-points-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

plot(ax: Axes = 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