SlantUpLines#

class data_morph.shapes.lines.SlantUpLines(dataset: Dataset)[source]#

Bases: LineCollection

Class for the slant up lines shape.

../_images/data_morph-shapes-lines-SlantUpLines-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) float#

Calculate the minimum distance from the lines of this shape to a point (x, y).

Parameters:
Returns:

The minimum distance from the lines of this shape to the point (x, y).

Return type:

float

Notes

Implementation based on this Stack Overflow answer.

lines#

An iterable of two (x, y) pairs representing the endpoints of a line.

Type:

Iterable[Iterable[numbers.Number]]

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