Skip to content

Commit 57ad96d

Browse files
Implement warning for Text3D's rotation/rotation_mode parameters (matplotlib#30600)
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 3ba3d6f commit 57ad96d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ class Text3D(mtext.Text):
123123

124124
def __init__(self, x=0, y=0, z=0, text='', zdir='z', axlim_clip=False,
125125
**kwargs):
126+
if 'rotation' in kwargs:
127+
_api.warn_external(
128+
"The `rotation` parameter has not yet been implemented "
129+
"and is currently ignored."
130+
)
131+
if 'rotation_mode' in kwargs:
132+
_api.warn_external(
133+
"The `rotation_mode` parameter has not yet been implemented "
134+
"and is currently ignored."
135+
)
126136
mtext.Text.__init__(self, x, y, text, **kwargs)
127137
self.set_3d_properties(z, zdir, axlim_clip)
128138

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,16 @@ def text(self, x, y, z, s, zdir=None, *, axlim_clip=False, **kwargs):
19501950
`.Text3D`
19511951
The created `.Text3D` instance.
19521952
"""
1953+
if 'rotation' in kwargs:
1954+
_api.warn_external(
1955+
"The `rotation` parameter has not yet been implemented "
1956+
"and is currently ignored."
1957+
)
1958+
if 'rotation_mode' in kwargs:
1959+
_api.warn_external(
1960+
"The `rotation_mode` parameter has not yet been implemented "
1961+
"and is currently ignored."
1962+
)
19531963
text = super().text(x, y, s, **kwargs)
19541964
art3d.text_2d_to_3d(text, z, zdir, axlim_clip)
19551965
return text

0 commit comments

Comments
 (0)