FigureEight#
- class data_morph.shapes.points.figure_eight.FigureEight(dataset: Dataset)[source]#
 Bases:
PointCollectionClass for the figure eight shape.
This shape is generated using the panda dataset.#
- Parameters:
 dataset (Dataset) – The starting dataset to morph into other shapes. For datasets with larger y ranges than x ranges, the figure eight will be vertical; otherwise, it will be horizontal.
Notes
This shape uses the formula for the Lemniscate of Bernoulli. It will orient itself vertically or horizontally depending on which direction has a larger range in the input dataset. For example, the panda dataset used above resulted in a horizontal orientation, but the music dataset results in a vertical orientation:
This shape is generated using the music dataset.#
- distance(x: Number, y: Number) float#
 Calculate the minimum distance from the points of this shape to 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 minimum distance from the points of this shape to the point (x, y).
- Return type:
 
- name: str | None = 'figure_eight'#
 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
Axesobject to plot on.- Returns:
 The
Axesobject containing the plot.- Return type:
 
- points#
 An array of (x, y) values representing an arrangement of points.
- Type: