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

Implementarrow3d method inAxes3D#30517

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

Open
AdwaithBatchu wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromAdwaithBatchu:feature/arrows3d

Conversation

@AdwaithBatchu
Copy link

PR summary

closes#22571

This PR implements a method to plot a 3D arrow.

Theax.arrow3d method plots a single arrow between specified end, start points. It returns an instance of theArrow3D class, which inherits from theFancyArrowPatch class. Additional kwargs are passed on toFancyArrowPatch to change properties of the arrow.

PR checklist

Copy link
Member

@story645story645 left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this! I would love to see a version of this in the library, but my strong preference is for the signature to match FancyArrowPatch.

AdwaithBatchu reacted with thumbs up emoji
"""
3D FancyArrowPatch object.
"""
def__init__(self,xs,ys,zs,*args,**kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def__init__(self,xs,ys,zs,*args,**kwargs):
def__init__(self,posA,posB,*args,**kwargs):

I think the signature should match the FancyArrowPatch signature unless you have a reason not to. I implemented a rudimentary version with this signature:
https://github.com/story645/team/blob/00c7374cefb216e51b8f8350a4b5512ec1068a99/paper/figcode/nontrivial.py#L54-L64

@timhoffm
Copy link
Member

timhoffm commentedSep 5, 2025
edited
Loading

IMO the major challenge here is semantics, scope and API design and that will entail the same topics as#29826 (comment), which lead to stalling in that thread. After all, we should have a consistent story between 2d and 3d. - I suspect to move forward here, we have to pick up the discussion from#29826.

scottshambaugh reacted with thumbs up emoji

@ksunden
Copy link
Member

While I think the more substantive discussion/change is likely the API discussion above/in the issue linked above, a small technical note that the test failure on ARM (at least, logs are gone for the azure) does appear to be a small deviation in the image, most likely due to rounding modes on the CPU architecture (RMS 0.001) so adding a tolerance may be necessary.

@AdwaithBatchu
Copy link
Author

This PR is similar toVector #22435, and is intended to plot 'data' rather than 'annotate'.

However the Vector PR is currently inactive. It seems like this is because of the presence of another functionannotate() which could be called without text to achieve similar results in 2D. However, I believe this does not apply for this PR as there is noannotate3d method.

If there are plans for Vector to be merged, I could follow the same API (mentioned inthis comment) for this PR and also rename the function fromarrow3d tovector3d. Now, as this used to plot 'data', it can also be changed to follow a certain color cycle by default.

I would like to know your thoughts on these@timhoffm

@timhoffm
Copy link
Member

@AdwaithBatchu as written in#30517 (comment) I think we have to first solve the 2D case to ensure API consistency.

We currently do not have the resources and priority to work on that.

This unfortunately means working on arrow3d is blocked.

As a temporary solution, you could create an example in the 3D section of our gallery, containingarrow3d as a standalone function. So that there is documented way how to draw 3d arrows, but we don't have to set an API in stone yet or ensure coverage of edge cases.

story645 reacted with thumbs up emoji

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

Reviewers

@story645story645story645 left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

Documentation: examplesfiles in galleries/examplestopic: mplot3d

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[ENH]: FancyArrow in 3D

4 participants

@AdwaithBatchu@timhoffm@ksunden@story645

[8]ページ先頭

©2009-2025 Movatter.jp