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

Addset_XY andset_data toQuiver#22407

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

Closed
ianhi wants to merge2 commits intomatplotlib:mainfromianhi:quiver-set
Closed

Conversation

ianhi
Copy link
Contributor

PR Summary

Willclose#22402 andclose#11790

still a bit of tidying up to do, and should probably pair with a similar implementation for Barb.

Opening early to get feedback I think I did all the shape setting correctly, but not entirely clear whats happening with all the masking. Also this will enable modifying the number of points and there was originally some concern about that.

Example script:

importmatplotlib.pyplotaspltimportnumpyasnpX,Y=np.random.rand(10,2).TU,V=np.random.rand(10,2).Tfig,ax=plt.subplots()Q=ax.quiver(X,Y,U,V)plt.show(block=False)plt.pause(2)X,Y,U,V,C=np.random.rand(11,5).TQ.set_data(X,Y,U,V,C)fig.canvas.draw()plt.show(block=True)

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).

@jklymak
Copy link
Member

The API seems fine, though I wonder about providing the conveniences, versus justset_data. Why does your example need a fig.canvas.draw? (= fig.draw_without_rendering)

@ianhi
Copy link
ContributorAuthor

The API seems fine, though I wonder about providing the conveniences, versus just set_data.

I put in both sinceset_UVC already exists although i suppose instead that could be deprecated?

fig.canvas.draw? (= fig.draw_without_rendering)

I'm a bit confused. the example changes after some time so since it's displayed already you need to call draw to update it

@jklymak
Copy link
Member

I dont think of fig.canvas.draw as user-facing.

@ianhi
Copy link
ContributorAuthor

fig.canvas.draw (or draw_idle) is crucial when doing anything interactive withset_data etc. For example see the slider examples:https://matplotlib.org/stable/gallery/widgets/slider_demo.html orhttps://matplotlib.org/stable/gallery/animation/strip_chart.html?highlight=codex%20fig%20canvas%20draw here it's necessary to update the figure because the second show doesn't force a draw.

jklymak reacted with thumbs up emoji

arrows; their locations are fixed when the class is
instantiated. Possibly this method will be useful
in animations.
The only API methods are ``set_UVC()``, ``set_XY``,
Copy link
Member

Choose a reason for hiding this comment

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

Remove "only"? (Does three count as only?)

Single back-ticks will link, right? I guess one should be consistent with either using() for all or none of the methods.

@oscargus
Copy link
Member

Couldn't comment in the source, butBarbs has this in the docs:

The only API method is :meth:`set_UVC`, which can be used to

which no longer is correct.

@oscargus
Copy link
Member

I think this would be nice to get into 3.7. Would you have time to update it?

I guess one can use the docs of the original Quiver class to explain the U, V, and C arguments inset_data.

@ianhi
Copy link
ContributorAuthor

I think this would be nice to get into 3.7. Would you have time to update it?

maybe - when is the deadline there? jan 1?

Also dependent on figuring out what I meant by:

still a bit of tidying up to do

also

and should probably pair with a similar implementation for Barb.

probably won't be able to do that

Comment on lines +604 to +605
U, V : ???
C : ???
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

note to self - this is part of the "cleaning up"

@oscargus
Copy link
Member

maybe - when is the deadline there? jan 1?

As I understand it, yes, but with some margins.

@timhoffm
Copy link
Member

and should probably pair with a similar implementation for Barb.

probably won't be able to do that

We can still do that later. Already having this onQuiver is an improvement, and I assumeBarb is less often used compared toQuiver.

@jklymak
Copy link
Member

@ianhi I'll move to Draft until you have time to come back to this...

@jklymakjklymak marked this pull request as draftJanuary 24, 2023 17:23
@ksundenksunden modified the milestones:v3.8.0,v3.9.0Aug 8, 2023
@rcomerrcomer mentioned this pull requestOct 11, 2023
3 tasks
@QuLogic
Copy link
Member

This was replaced by#26410.

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

@oscargusoscargusoscargus left review comments

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

Successfully merging this pull request may close these issues.

[Doc]: Quiver docstring incorrectly claims that onlyUVC can be set Feature request: set_XY in quiver plots
6 participants
@ianhi@jklymak@oscargus@timhoffm@QuLogic@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp