Using ggplot, I have multiple plots, each of which has a legend box. I want the legend box to be the same width for each plot, but ggplot dynamically sizes the legend box based on the legend name, key values, etc. (which are unique to each plot).
The various plots must fit into a specified publication slot, with a specified width for the legend, and the plots must be made separately (so faceting to guarantee identical legend widths across the plots isn't possible).
In essence, I have a fixed 'template' for the plot, such that some external elements outside the plot's boundaries are 'lined-up' correctly.
theme I couldn't find an option to specify the legend box width ... any ideas?
I played around with the legend margin, but really I want to specify the legend 'minimal' bounding-box plus have the margin be dynamically padded such that the sum of the two is a fixed-width box.
Alternatively, I thought to specify the document width, then specify the plot and/or legend widths, left-justify those elements, then let there be 'free space' on the right side of the document, but I can't seem to find any existing set of options to let me easily do this.