Skip to content

Commit b528db5

Browse files
authored
Change plot layout for all datasets visual; check aspect ratio on resulting plot in tests (#279)
1 parent 6eec1d7 commit b528db5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/data_morph/data/loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,15 @@ def plot_available_datasets(cls) -> Axes:
136136
The list of available datasets built into Data Morph.
137137
"""
138138
num_plots = len(cls.AVAILABLE_DATASETS)
139-
num_cols = 3
139+
num_cols = 4
140140
num_rows = int(np.ceil(num_plots / num_cols))
141+
scale = 4
141142

142143
fig, axs = plt.subplots(
143144
num_rows,
144145
num_cols,
145146
layout='constrained',
146-
figsize=(12, 4 * num_rows),
147+
figsize=(scale * num_cols, scale * num_rows),
147148
subplot_kw={'aspect': 'equal'},
148149
)
149150
fig.get_layout_engine().set(w_pad=0.2, h_pad=0.2)

tests/data/test_loader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ def test_plot_available_datasets(self, monkeypatch, subset):
7373
assert subplot_title.endswith(' points)')
7474
if dataset in ['Python', 'SDS']:
7575
assert 'logo' in subplot_title
76+
assert ax.get_aspect() == 1

0 commit comments

Comments
 (0)