Circle#

class data_morph.shapes.circles.Circle(dataset: Dataset, radius: Number | None = None)[source]#

Bases: Shape

Class representing a hollow circle.

../_images/data_morph-shapes-circles-Circle-1.png

This shape is generated using the panda dataset.#

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

  • radius (numbers.Number, optional) – The radius of the circle.

center: ndarray#

The (x, y) coordinates of the circle’s center.

Type:

numpy.ndarray

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

Calculate the absolute distance between this circle’s edge and a point (x, y).

Parameters:
Returns:

The absolute distance between this circle’s edge and the point (x, y).

Return type:

float

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[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

radius: Number#

The radius of the circle.

Type:

numbers.Number