Skip to content

Commit b1bd99b

Browse files
committed
Add shape diagnostic check to shape creation tutorial
1 parent 1d94315 commit b1bd99b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/tutorials/shape-creation.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ shape inherits from :class:`.LineCollection` and uses the morph bounds
6666
Since we inherit from :class:`.LineCollection` here, we don't need to define
6767
the ``distance()`` and ``plot()`` methods (unless we want to override them).
6868

69+
.. tip::
70+
You can use the :func:`.plot_shape_on_dataset` function to visualize your shape's
71+
positioning relative to a given dataset:
72+
73+
.. plot::
74+
:scale: 75
75+
:include-source:
76+
:caption:
77+
Visualization of how the :class:`.XLines` looks when calculated based on the
78+
music :class:`.Dataset`, with the dataset's bounds.
79+
80+
from data_morph.data.loader import DataLoader
81+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
82+
from data_morph.shapes.lines import XLines
83+
84+
85+
dataset = DataLoader.load_dataset('music')
86+
shape = XLines(dataset)
87+
plot_shape_on_dataset(dataset, shape, show_bounds=True, alpha=0.1)
88+
6989
Test out the shape
7090
------------------
7191

0 commit comments

Comments
 (0)