Closed hffqyd closed 4 years ago
This is another case of something not being exposed just yet. I'll add that soon.
The layout is currently hardcoded depending on whether a legend is required or not here: https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim.nim#L1382-L1432
This will simply be something that can be set by the used Theme
by extending it:
https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/ggplot_types.nim#L232-L267
and handing that to the layouting procs above.
Thanks for you reply. Waiting for your completion and I'll test for it.
Something I forgot to mention: You can also always rotate the labels for a better fit using using the rotate
argument to xlab/ylab
as done here:
OK, thank you. I'll try it.
Finally got around to implementing this. See here:
edit: feel free to reopen, if this doesn't work as you expect.
I encountered a problem that when I had a very long label in a plot, it exceeded the figure. Take the example below:
The label of "a very long long label" would exceed the left edge.
I found a solution in "recipes.org" using
ggcreate()
,initViewport()
to set extra space to the left and embed the figure in the right.The code worked. But I'm wondering if there is a more convenient way to set margin to avoid long label exceeding? Thanks for kindly help!