lines#

Shapes that are lines of lines.

Classes

HighLines(dataset)

Class for the high lines shape.

HorizontalLines(dataset)

Class for the horizontal lines shape.

SlantDownLines(dataset)

Class for the slant down lines shape.

SlantUpLines(dataset)

Class for the slant up lines shape.

VerticalLines(dataset)

Class for the vertical lines shape.

WideLines(dataset)

Class for the wide lines shape.

XLines(dataset)

Class for the X shape consisting of two crossing, perpendicular lines.

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

Bases: LineCollection

Class for the high lines shape.

../_images/data_morph-shapes-lines-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

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

Bases: LineCollection

Class for the horizontal lines shape.

../_images/data_morph-shapes-lines-2.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

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

Bases: LineCollection

Class for the slant down lines shape.

../_images/data_morph-shapes-lines-3.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

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

Bases: LineCollection

Class for the slant up lines shape.

../_images/data_morph-shapes-lines-4.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

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

Bases: LineCollection

Class for the vertical lines shape.

../_images/data_morph-shapes-lines-5.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

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

Bases: LineCollection

Class for the wide lines shape.

../_images/data_morph-shapes-lines-6.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

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

Bases: LineCollection

Class for the X shape consisting of two crossing, perpendicular lines.

../_images/data_morph-shapes-lines-7.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