Description
When generating multi-panel plots with plot() in CroPlotR, the legend is currently positioned beside the panels (default behavior).
However, when the legend is wider than a single panel (e.g., many groups, long labels, or both), this results in compressed panels and poor readability.
In such cases, placing the legend to the right of the panels negatively impacts the visual clarity of the figure.
Expected behavior
If the legend width exceeds the width of a single panel, the legend should automatically be placed below the plots, rather than beside them.
Suggested implementation
- Detect legend grob width relative to panel width.
- If legend width > panel width:
- Switch legend position to
"bottom".
- Otherwise, keep the default placement.
Description
When generating multi-panel plots with
plot()in CroPlotR, the legend is currently positioned beside the panels (default behavior).However, when the legend is wider than a single panel (e.g., many groups, long labels, or both), this results in compressed panels and poor readability.
In such cases, placing the legend to the right of the panels negatively impacts the visual clarity of the figure.
Expected behavior
If the legend width exceeds the width of a single panel, the legend should automatically be placed below the plots, rather than beside them.
Suggested implementation
"bottom".