MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / plot

Method plot

lib/mpl_toolkits/mplot3d/axes3d.py:2200–2242  ·  view source on GitHub ↗

Plot 2D or 3D data. Parameters ---------- xs : 1D array-like x coordinates of vertices. ys : 1D array-like y coordinates of vertices. zs : float or 1D array-like z coordinates of vertices; either one for all points

(self, xs, ys, *args, zdir='z', axlim_clip=False, **kwargs)

Source from the content-addressed store, hash-verified

2198 text2D = Axes.text
2199
2200 def plot(self, xs, ys, *args, zdir='z', axlim_clip=False, **kwargs):
2201 """
2202 Plot 2D or 3D data.
2203
2204 Parameters
2205 ----------
2206 xs : 1D array-like
2207 x coordinates of vertices.
2208 ys : 1D array-like
2209 y coordinates of vertices.
2210 zs : float or 1D array-like
2211 z coordinates of vertices; either one for all points or one for
2212 each point.
2213 zdir : {'x', 'y', 'z'}, default: 'z'
2214 When plotting 2D data, the direction to use as z.
2215 axlim_clip : bool, default: False
2216 Whether to hide data that is outside the axes view limits.
2217
2218 .. versionadded:: 3.10
2219 **kwargs
2220 Other arguments are forwarded to `matplotlib.axes.Axes.plot`.
2221 """
2222 had_data = self.has_data()
2223
2224 # `zs` can be passed positionally or as keyword; checking whether
2225 # args[0] is a string matches the behavior of 2D `plot` (via
2226 # `_process_plot_var_args`).
2227 if args and not isinstance(args[0], str):
2228 zs, *args = args
2229 if 'zs' in kwargs:
2230 raise TypeError("plot() for multiple values for argument 'zs'")
2231 else:
2232 zs = kwargs.pop('zs', 0)
2233
2234 xs, ys, zs = cbook._broadcast_with_masks(xs, ys, zs)
2235
2236 lines = super().plot(xs, ys, *args, **kwargs)
2237 for line in lines:
2238 art3d.line_2d_to_3d(line, zs=zs, zdir=zdir, axlim_clip=axlim_clip)
2239
2240 xs, ys, zs = art3d.juggle_axes(xs, ys, zs, zdir)
2241 self.auto_scale_xyz(xs, ys, zs, had_data)
2242 return lines
2243
2244 plot3D = plot
2245

Callers 15

stemMethod · 0.95
test_lines3dFunction · 0.45
test_plot_scalarFunction · 0.45
test_mixedsubplotsFunction · 0.45
test_plot_3d_from_2dFunction · 0.45
test_plot_scatter_masksFunction · 0.45
test_proj_axes_cubeFunction · 0.45
test_autoscaleFunction · 0.45
test_cullingFunction · 0.45
test_axlim_clipFunction · 0.45

Calls 3

auto_scale_xyzMethod · 0.95
has_dataMethod · 0.80
popMethod · 0.45

Tested by 15

test_lines3dFunction · 0.36
test_plot_scalarFunction · 0.36
test_mixedsubplotsFunction · 0.36
test_plot_3d_from_2dFunction · 0.36
test_plot_scatter_masksFunction · 0.36
test_proj_axes_cubeFunction · 0.36
test_autoscaleFunction · 0.36
test_cullingFunction · 0.36
test_axlim_clipFunction · 0.36
test_invertedFunction · 0.36