Skip to content

long string of format_coord in osx backend #16498

Closed

Description

@zhihanyue

Bug report

Bug summary

I tried to customize the text of status bar using format_coord. When the text is long, the status bar of MacOSX backend wouldn't display properly (see image). It seems that the width of the text box does not automatically adjust with the size of the window.

WX20200214-000436@2x

Code for reproduction

ax.format_coord = A_LONG_STRING_HERE

Matplotlib version

  • Operating system: macos 10.14.6
  • Matplotlib version: 3.1.3
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.7.3

Activity

  1. QuLogic commented on Mar 7, 2020

    @QuLogic
    Member

    Indeed, the text box in the macOS backend does have a fixed width:

    matplotlib/src/_macosx.m

    Lines 1252 to 1255 in a712590

    rect.size.width = 300;
    rect.size.height = 0;
    rect.origin.x += height;
    NSText* messagebox = [[NSText alloc] initWithFrame: rect];

    But it would take someone more familiar with macOS than I to know whether it can auto-resize.

  2. added this to the v3.3.0 milestone on Mar 12, 2020
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