Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make format_coord messagebox resize with the window and the content in osx backend#16710

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 2 commits intomatplotlib:masterfromzhihanyue:macosgui-resize
Mar 12, 2020

Conversation

zhihanyue
Copy link
Contributor

@zhihanyuezhihanyue commentedMar 8, 2020
edited
Loading

PR Summary

  • adjust the width of messagebox with the window size
  • display in two lines properly when its width is not enough for single-line display

closes#16498

Example:

from matplotlib import pyplot as pltimport numpy as npx = np.linspace(-5, 5, 1000)y = x ** 2fig = plt.figure()ax1 = fig.add_subplot(1, 1, 1)def my_format_coord(x, y):    return f'the x-coordinate = {x}, the y-coordinate = {y}'ax1.format_coord = my_format_coordax1.plot(x, y)plt.show()

Before:
before1
before2

After:
after1
after2
after3

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not an OSX programmer, but from the outside this looks reasonable. Maybe someone with OSX can test this?

@jklymak
Copy link
Member

The only issue here is that the height over runs the toolbar if the window is very narrow

@jklymak
Copy link
Member

overflow

@zhihanyue
Copy link
ContributorAuthor

@jklymak

Thx. It occurred when the width of the toolbar is too small to hold the text.

I have fixed this by limiting the maximum number of lines to 2. Now it shows perfectly at any width.

WX20200310-120942@2x

jklymak reacted with thumbs up emoji

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Also not an OSX programer, but the proof is in the pudding that this works.

@jklymakjklymak added this to thev3.3.0 milestoneMar 10, 2020
@QuLogic
Copy link
Member

Seems to be enough approvals to merge. Thanks @yuezhihan!

@jtleighton
Copy link

Been waiting for this for over 2 years - thank you! (re:#10375)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@jklymakjklymakjklymak approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.3.0
Development

Successfully merging this pull request may close these issues.

long string of format_coord in osx backend
7 participants
@zhihanyue@jklymak@QuLogic@jtleighton@tacaswell@timhoffm@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp