Open befriendabacterium opened 8 months ago
Hi @befriendabacterium,
Thanks for this issue too!
Yes, this is a tricky problem to solve, and to be honest, the best approach I have found is to leave it up to the user to reduce the font size/move the domain names. I personally don't like that the legend is not aligned with the edge of the plot but rather with the edge of the "Study" axis label, but it is definitely a personal preference!
Somewhat relatedly, the development version of robvis
contains a function called rob_save()
which tries to use some information about the plots to set reasonable defaults for the width/height when writing the file out. However, this function does not account for legend text size.
One other option would be to include an argument to "stack" the domain names and judgement labels, that users could specify if they wanted a narrow plot?
Hi Luke,
Cool thanks for clarifying. Yes, a tricky one. I'll just stick to my manual fix for now then. Will leave it up to you as to whether you wanna close this or not!
Cheers Matt
P.S. robsave seems to perform pretty well too - thanks for flagging!
Describe the bug
When you make the plot too narrow (desirable for aesthetic reasons to reduce whitespace), the Domains caption and Judgement legends overlap. See screenshot.
To Reproduce
And observe the outputted plot.
Expected behavior This is sort of expected, but it can make it tricky to limit whitespace when you have a lot of studies whilst also preventing overlap of the Domains caption and Judgement legend. One option to make it a bit more versatile would be to push the Domain caption to the lwft edge of the Study labels rather than placing it at the left edge of the traffic lighted area. Alternatively, the font size auto-adjusts to the plot dimensions but i've no idea how that'd work.
Screenshots
Desktop (please complete the following information):
Additional context As a temporary workaround, you can add a line to your ggplot object to push the Domain caption further left and/or reduce font size: