diagnostics#

Diagnostic plot to visualize a shape superimposed on the dataset.

Functions

plot_shape_on_dataset(dataset, shape[, ...])

Plot a shape superimposed on a dataset to evaluate heuristics.

data_morph.plotting.diagnostics.plot_shape_on_dataset(dataset: Dataset, shape: Shape, show_bounds: bool = False, alpha: Number = 0.25) Axes[source]#

Plot a shape superimposed on a dataset to evaluate heuristics.

Parameters:
  • dataset (Dataset) – The dataset that shape was instantiated with.

  • shape (Shape) – The shape that was instantiated with dataset.

  • show_bounds (bool, default False) – Whether to include the dataset’s bounds in the plot.

  • alpha (Number, default 0.25) – The transparency to use for the dataset’s points.

Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes

Examples

from data_morph.data.loader import DataLoader
from data_morph.plotting.diagnostics import plot_shape_on_dataset
from data_morph.shapes.lines import Star

dataset = DataLoader.load_dataset('music')
shape = Star(dataset)
plot_shape_on_dataset(dataset, shape, show_bounds=True, alpha=0.1)
../_images/data_morph-plotting-diagnostics-1.png

Visualization of the Star shape when calculated based on the music Dataset, with the dataset’s bounds.#

from data_morph.data.loader import DataLoader
from data_morph.plotting.diagnostics import plot_shape_on_dataset
from data_morph.shapes.points import Heart

dataset = DataLoader.load_dataset('music')
shape = Heart(dataset)
plot_shape_on_dataset(dataset, shape, alpha=0.1)
../_images/data_morph-plotting-diagnostics-2.png

Visualization of the Heart shape when calculated based on the music Dataset, without the dataset’s bounds.#