shape#

Abstract base class for shapes.

Classes

Shape()

Abstract base class for a shape.

class data_morph.shapes.bases.shape.Shape[source]#

Bases: ABC

Abstract base class for a shape.

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

Calculate the distance between this shape and a point (x, y).

Parameters:
Returns:

The distance between this shape and the point (x, y).

Return type:

float

abstract plot(ax: Axes = None) Axes[source]#

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

Notes

When implementing this method for subclasses, make sure to apply the plotting.style.plot_with_custom_style() decorator.