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

Implement warning for Text3D's rotation/rotation_mode parameters#30600

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
melwyncarlo wants to merge4 commits intomatplotlib:main
base:main
Choose a base branch
Loading
frommelwyncarlo:issue_30563

Conversation

melwyncarlo
Copy link

PR summary

Currently, therotation androtation_mode parameters are ignored for theText3D class.
This affects code that accesses the class directly, as well as via theAxes3D.text function.

There is no implementation for the true 3D rotation of text in the current codebase.
It only rotates the text about the axis going through the display screen (set via thezdir parameter).
Implementing it is a serious undertaking which can't be achieved in a short matter of time.

Nevertheless, the parameters for it do exist in the public API which confuses users when they don't work as intended.
Therefore, a warning would be beneficial to warn the user about those two parameters being ignored/unimplemented.

This issue provisionallycloses#30563.


def__init__(self,x=0,y=0,z=0,text='',zdir='z',axlim_clip=False,
**kwargs):
ifkwargs.get('rotation',None)isnotNone:
Copy link
Member

Choose a reason for hiding this comment

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

Can we change to

Suggested change
ifkwargs.get('rotation',None)isnotNone:
if"rotation"inkwargs:

? It's not exactly the same in thatText3D(... roation=None) is differently handled. But unless we have internal reasons to accept that. We can warn on that case as well.

Copy link
Author

Choose a reason for hiding this comment

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

Changed.

I didif kwargs.get('rotation', None) is not None: thinking that if a code were to programmatically passNone as an argument, then it would not invoke the warnings.
On the other hand,if "rotation" in kwargs would show the warnings even if those parameters were set toNone.

def__init__(self,x=0,y=0,z=0,text='',zdir='z',axlim_clip=False,
**kwargs):
ifkwargs.get('rotation',None)isnotNone:
warnings.showwarning(
Copy link
Member

Choose a reason for hiding this comment

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

you may want to use

Suggested change
warnings.showwarning(
_api.warn_external(

https://matplotlib.org/stable/api/_api_api.html#matplotlib._api.warn_external

Copy link
Author

Choose a reason for hiding this comment

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

Done

"""

importmath
importwarnings
Copy link
Contributor

@scottshambaughscottshambaughSep 26, 2025
edited
Loading

Choose a reason for hiding this comment

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

Remove the unused import, then this PR lgtm.

The linked issue should be kept open after this is merged.

@QuLogicQuLogic changed the titleUnimplemented warning for Text3D's rotation/rotation_mode parametersImplement warning for Text3D's rotation/rotation_mode parametersSep 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm left review comments

@scottshambaughscottshambaughscottshambaugh left review comments

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

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: 3D text does not respect rotation to make it parallel with a given zdir axis
3 participants
@melwyncarlo@timhoffm@scottshambaugh

[8]ページ先頭

©2009-2025 Movatter.jp