Skip to content
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

Multi-line ticks cause cut-offs #15576

Closed
vadimkantorov opened this issue Oct 30, 2019 · 9 comments
Closed

Multi-line ticks cause cut-offs #15576

vadimkantorov opened this issue Oct 30, 2019 · 9 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Oct 30, 2019

UPD #14705 fixes this issue

Unfortunately I can't provide a full MWE at this moment (I'll try to find time and update with code), but I thought reporting will still be good anyway.

I want to use cyrillic text ticks in order to debug a speech recognition system. I plot either the top-1 character prediction or top-2. I use mutli-line ticks in order to plot two character predictions. In top-2 mode the labels get cut off, including the label that's on the first line.

When top-1 prediction is plotted:
image

When top-2 predictions are plotted (note the cut-off labels).
image

The labels are not affected by any randomness, the only difference is using ticks of 1 character or 3 characters (counting the newline character). Essentially I'd use an appropriate rotation mode if it existed.

Potentially related issue with a MWE: https://stackoverflow.com/questions/53942480/how-can-i-change-the-text-direction-of-tick-labels-in-matplotlib

@jklymak
Copy link
Member

jklymak commented Oct 30, 2019

The last answer in the stack overflow link looks like it should work for you. If things are being clipped you will have to make more room between the bottom of the axes and the bottom of the figure.

@jklymak jklymak added the status: needs clarification Issues that need more information to resolve. label Oct 30, 2019
@vadimkantorov
Copy link
Author

@jklymak are you refering to https://stackoverflow.com/a/53942830? I already use multi-line ticks. The problem is that the labels get cut off weirdly as in the screenshots. The first line in the first screenshot should perfeclty match the first line of the second screenshot and this is not the case.

@jklymak
Copy link
Member

jklymak commented Oct 30, 2019

Hard to know why w/o some code duplicating the problem...

@vadimkantorov
Copy link
Author

I know :( I'll try to provide a MWE, meanwhile the stackoverflow question may be hitting the same issue: labels getting cut off when using mutli-line labels

@anntzer
Copy link
Contributor

anntzer commented Oct 30, 2019

does #14705 help?

@vadimkantorov
Copy link
Author

@anntzer Yes! It does help! I wonder if it also solves the stackoverflow MWE with labels in Chinese.

@anntzer anntzer removed the status: needs clarification Issues that need more information to resolve. label Oct 30, 2019
@anntzer
Copy link
Contributor

anntzer commented Oct 30, 2019

Yes, it does.

@vadimkantorov
Copy link
Author

Is the fix for this available in 3.2.0rc2? I've installed it from pip install https://github.com/matplotlib/matplotlib/archive/v3.2.0rc2.tar.gz and am still hitting this bug

@vadimkantorov
Copy link
Author

version 3.1.0 with that fix applied manually worked fine if I remember well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants