-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can the long plot title be auto-wrapped? #95
Comments
Hey! Great to hear from you. :) That's a good point. I've thought about this myself sometimes. I just wasn't sure if breaking the line is the most desired behavior. That is mainly because of the amount of space in the header part by default. I've already implemented manual line wrapping support for the annotations. So it shouldn't be too hard to apply this here. I'll give this a try! Don't want to make any promises, but I'll put it into the PR that's been open for a week or so (plus some other stuff I have sitting locally already). |
Finally gave it a try to implement this morning. Was indeed pretty easy. The only thing I did not implement (because I think it's not desired behavior by default) is to extend the region of the header to accommodate multiple lines. So in case one expects multiple lines in the header, it's required to either set a smaller font thane the default (using the I'll push this to the PR now. |
#93 is merged now. Let me know if the behavior is what you expect and if it could be nicer in some way! See the recipe here: |
Thanks! I will try this out today and let you know. Looking at your example (and I know you said that I need to specify the margin manually), one minor suggestion would be to auto-increase the margin as needed. The reason is that I am dynamically creating the title, and probably margin=2 will work for most cases. Just in case only margin=1 is enough, or if more lines are needed, can ggplotnim figure that out automatically? |
I thought about that. In principle I can do that fine. The reason why I decided against it is because by increasing the margin I have to do one of two things:
Now that you mention it however, it would probably be a good idea to allow auto resizing by supplying an argument to the |
I updated ggplotnim from HEAD and I confirm the auto-wrapping and margin option. Thanks! For now, I will start using margin=2 for my plots. But if the auto-margin works out, it would be great! :) |
Hello,
I was just using this package to dynamically construct the plot titles and often the titles would get longer than the image widths and get truncated. Here's a simple example using the first example in the recipe.org:
This will create
This is using the latest release of ggplotnim, 0.3.18.
I tried using
\n
and\\n
in the string passed toggtitle
but that didn't work.Can you enable auto-wrapping of the title, and/or allow a way to insert newlines in the title?
Thanks!
The text was updated successfully, but these errors were encountered: