From 59eb63410fdcb46c0e2d100193970507b62ba0fa Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Mon, 19 Jun 2023 13:02:29 +0100 Subject: [PATCH] Backport PR #26148: Clarify how to get data from Line3D and fix formatting issue --- lib/mpl_toolkits/mplot3d/art3d.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index 011c7ce358f6..b0e27a30618c 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -183,6 +183,12 @@ def text_2d_to_3d(obj, z=0, zdir='z'): class Line3D(lines.Line2D): """ 3D line object. + + .. note:: Use `get_data_3d` to obtain the data associated with the line. + `~.Line2D.get_data`, `~.Line2D.get_xdata`, and `~.Line2D.get_ydata` return + the x- and y-coordinates of the projected 2D-line, not the x- and y-data of + the 3D-line. Similarly, use `set_data_3d` to set the data, not + `~.Line2D.set_data`, `~.Line2D.set_xdata`, and `~.Line2D.set_ydata`. """ def __init__(self, xs, ys, zs, *args, **kwargs): @@ -196,8 +202,8 @@ def __init__(self, xs, ys, zs, *args, **kwargs): The y-data to be plotted. zs : array-like The z-data to be plotted. - - Additional arguments are passed onto :func:`~matplotlib.lines.Line2D`. + *args, **kwargs : + Additional arguments are passed to `~matplotlib.lines.Line2D`. """ super().__init__([], [], *args, **kwargs) self.set_data_3d(xs, ys, zs)
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: