Skip to content

Commit e70bfba

Browse files
improved spacing
1 parent 969f989 commit e70bfba

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,16 @@ def run_pathsim():
266266

267267
# Share x only if there are only scopes or only spectra
268268
shared_x = len(scopes) * len(spectra) == 0
269-
269+
n_rows = len(scopes) + len(spectra)
270+
absolute_vertical_spacing = 0.05
271+
relative_vertical_spacing = absolute_vertical_spacing / n_rows
270272
fig = make_subplots(
271-
rows=len(scopes) + len(spectra),
273+
rows=n_rows,
272274
cols=1,
273275
shared_xaxes=shared_x,
274276
subplot_titles=[scope.label for scope in scopes]
275277
+ [spec.label for spec in spectra],
276-
vertical_spacing=0.1,
278+
vertical_spacing=relative_vertical_spacing,
277279
)
278280

279281
# make scope plots
@@ -305,7 +307,7 @@ def run_pathsim():
305307
fig.update_xaxes(title_text="Frequency", row=len(scopes) + i + 1, col=1)
306308

307309
fig.update_layout(
308-
height=600 * (len(scopes) + len(spectra)), hovermode="x unified"
310+
height=500 * (len(scopes) + len(spectra)), hovermode="x unified"
309311
)
310312

311313
# Convert plot to JSON

0 commit comments

Comments
 (0)