-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathx_lines.py
More file actions
33 lines (23 loc) · 875 Bytes
/
x_lines.py
File metadata and controls
33 lines (23 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""X lines shape."""
from ...data.dataset import Dataset
from ..bases.line_collection import LineCollection
class XLines(LineCollection):
"""
Class for the X shape consisting of two crossing, perpendicular lines.
.. plot::
:scale: 75
:caption:
This shape is generated using the panda dataset.
from data_morph.data.loader import DataLoader
from data_morph.shapes.lines import XLines
_ = XLines(DataLoader.load_dataset('panda')).plot()
Parameters
----------
dataset : Dataset
The starting dataset to morph into other shapes.
"""
name = 'x'
def __init__(self, dataset: Dataset) -> None:
xmin, xmax = dataset.morph_bounds.x_bounds
ymin, ymax = dataset.morph_bounds.y_bounds
super().__init__([[xmin, ymin], [xmax, ymax]], [[xmin, ymax], [xmax, ymin]])