Skip to content

Multi-line ticks cause cut-offs #15576

Closed
Closed

Description

@vadimkantorov

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

Activity

  1. jklymak commented on Oct 30, 2019

    @jklymak
    Member

    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.

  2. vadimkantorov commented on Oct 30, 2019

    @vadimkantorov
    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.

  3. jklymak commented on Oct 30, 2019

    @jklymak
    Member

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

  4. vadimkantorov commented on Oct 30, 2019

    @vadimkantorov
    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

  5. anntzer commented on Oct 30, 2019

    @anntzer
    Contributor

    does #14705 help?

  6. vadimkantorov commented on Oct 30, 2019

    @vadimkantorov
    Author

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

  7. anntzer commented on Oct 30, 2019

    @anntzer
    Contributor

    Yes, it does.

  8. modified the milestones: v3.3.0, v3.2.0 on Oct 31, 2019
  9. vadimkantorov commented on Dec 24, 2019

    @vadimkantorov
    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

  10. vadimkantorov commented on Dec 24, 2019

    @vadimkantorov
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions