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

Fix quad mesh cursor data#22907

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

Conversation

raphaelquast
Copy link
Contributor

@raphaelquastraphaelquast commentedApr 26, 2022
edited by oscargus
Loading

PR Summary

Closes:#22908

This is just a very minor bug I noticed...

When using aQuadMeshwithout setting an array, theget_cursor_data function throws an error because it does not check if an array has been set.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@oscargusoscargus added the status: needs workflow approvalFor PRs from new contributors, from which GitHub blocks workflows by default. labelApr 29, 2022
@oscargus
Copy link
Member

I took the liberty of editing your post to point out the issue number. In this way, Github links this PR and the issue and the issue will be automatically closed when this is merged.

@raphaelquast
Copy link
ContributorAuthor

@oscargus perfect, thanks! I don't have the rights to merge anything so this needs to be done by one of your devs as well!

oscargus reacted with thumbs up emoji

@QuLogicQuLogic added this to thev3.5.2 milestoneApr 30, 2022
@QuLogicQuLogic merged commit89b21b5 intomatplotlib:mainApr 30, 2022
@QuLogic
Copy link
Member

meeseeksdev backport to v3.5.x

@QuLogic
Copy link
Member

Thanks@raphaelquast! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

QuLogic added a commit that referenced this pull requestApr 30, 2022
…907-on-v3.5.xBackport PR#22907 on branch v3.5.x (Fix quad mesh cursor data)
@greglucas
Copy link
Contributor

I don't think this was quite right becauseget_array() often returns a numpy array, which when evaluated withif array raises a ValueError.

Hover the cursor over the figure in this example:

importmatplotlib.pyplotaspltimportnumpyasnpn=4x=np.arange(n)X=x[:,None]*x[None, :]fig,ax=plt.subplots()mesh=ax.pcolormesh(X)mesh.set_mouseover(True)plt.show()

@raphaelquast
Copy link
ContributorAuthor

@greglucas sorry... indeed that's not the desired behavior!

I opened a new pull request to fix this. (#22957)

  • if array >>if array is not None
    ... this should work as expected.
greglucas reacted with thumbs up emoji

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

@QuLogicQuLogicQuLogic approved these changes

@oscargusoscargusoscargus approved these changes

Assignees
No one assigned
Labels
status: needs workflow approvalFor PRs from new contributors, from which GitHub blocks workflows by default.
Projects
None yet
Milestone
v3.5.2
Development

Successfully merging this pull request may close these issues.

[Bug]: QuadMesh get_cursor_data errors if no array is set
4 participants
@raphaelquast@oscargus@QuLogic@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp