Skip to content

Commit 196078c

Browse files
committed
fix: make plot figures auto-size to fill available space
Remove hardcoded width/height from plot_mechanism_run and plot_offline_run, use autosize=True instead so plots fill the explorer window.
1 parent 27d4fb2 commit 196078c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/negmas/plots/util.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,10 +1868,9 @@ def plot_offline_run(
18681868
mark_max_welfare_points=mark_max_welfare_points,
18691869
)
18701870

1871-
# Update layout
1871+
# Update layout - use autosize for responsive sizing in viewers
18721872
fig.update_layout(
1873-
width=1280 if not only2d and not no2d else None,
1874-
height=480 if not only2d and not no2d else None,
1873+
autosize=True,
18751874
showlegend=True,
18761875
legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="center", x=0.5),
18771876
)
@@ -2101,10 +2100,9 @@ def plot_mechanism_run(
21012100
mark_max_welfare_points=mark_max_welfare_points,
21022101
)
21032102

2104-
# Update layout
2103+
# Update layout - use autosize for responsive sizing in viewers
21052104
fig.update_layout(
2106-
width=1280 if not only2d and not no2d else None,
2107-
height=480 if not only2d and not no2d else None,
2105+
autosize=True,
21082106
showlegend=True,
21092107
legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="center", x=0.5),
21102108
)

0 commit comments

Comments
 (0)