Skip to content

Commit 088e50b

Browse files
authored
Merge pull request #26148 from oscargus/line3ddoc
Clarify how to get data from Line3D and fix formatting issue
2 parents a73c347 + 6663a1d commit 088e50b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ def text_2d_to_3d(obj, z=0, zdir='z'):
183183
class Line3D(lines.Line2D):
184184
"""
185185
3D line object.
186+
187+
.. note:: Use `get_data_3d` to obtain the data associated with the line.
188+
`~.Line2D.get_data`, `~.Line2D.get_xdata`, and `~.Line2D.get_ydata` return
189+
the x- and y-coordinates of the projected 2D-line, not the x- and y-data of
190+
the 3D-line. Similarly, use `set_data_3d` to set the data, not
191+
`~.Line2D.set_data`, `~.Line2D.set_xdata`, and `~.Line2D.set_ydata`.
186192
"""
187193

188194
def __init__(self, xs, ys, zs, *args, **kwargs):
@@ -196,8 +202,8 @@ def __init__(self, xs, ys, zs, *args, **kwargs):
196202
The y-data to be plotted.
197203
zs : array-like
198204
The z-data to be plotted.
199-
200-
Additional arguments are passed onto :func:`~matplotlib.lines.Line2D`.
205+
*args, **kwargs :
206+
Additional arguments are passed to `~matplotlib.lines.Line2D`.
201207
"""
202208
super().__init__([], [], *args, **kwargs)
203209
self.set_data_3d(xs, ys, zs)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy