Open Yunuuuu opened 2 weeks ago
I've raised a similar issue before in #4722, but now that more people would want this, I think we should only reserve space for the elements that are drawn even more.
Thank you for pointing that out. I see the relevance of the previous issue. However, the current implementation of axis.ticks.length
might cause confusion for users, even if it aligns with the design principles of ggplot2. It may be worth considering a revision to improve clarity and user experience.
In situations when we want to remove margins, we must set both ticks and ticks length to remove the width/heigth of axis in the underlying gtable. As user would expect the empty size when they remove the axis using
element_blank()
.Issue in stackoverflow: https://stackoverflow.com/questions/40407498/how-to-remove-margins-in-ggplot2-chart
Please note the 10th height which is the height of the axis grob.
Created on 2024-09-01 with reprex v2.1.0