shape#
Abstract base class for shapes.
Classes
|
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:
x (numbers.Number) – Coordinates of a point in 2D space.
y (numbers.Number) – Coordinates of a point in 2D space.
- Returns:
The distance between this shape and the point (x, y).
- Return type:
- 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:
Notes
When implementing this method for subclasses, make sure to apply the
plotting.style.plot_with_custom_style()
decorator.