Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
[ENH] Add data parameter in Axes3D.plot#30270
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
base:main
Are you sure you want to change the base?
Changes fromall commits
b468641
58a7d21
b2f9714
ca0629b
ef4216c
ece6b0e
809e804
c451c29
edb05b7
93469e7
e75e13b
1d8d69d
c0b2bf7
688e153
34cd222
0598149
83157fa
98b9c66
0c04c8a
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1963,43 +1963,44 @@ def text(self, x, y, z, s, zdir=None, *, axlim_clip=False, **kwargs): | ||
text3D = text | ||
text2D = Axes.text | ||
@_preprocess_data(replace_names=['xs', 'ys', 'zs']) | ||
def plot(self, xs, ys, zs=0, fmt=None, *, zdir='z', axlim_clip=False, **kwargs): | ||
""" | ||
Plot 2D or 3D data. | ||
.. versionchanged:: 3.10 | ||
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 or one for | ||
each point. | ||
The signature was changed to make the parameters *zs* and *fmt* explicit. | ||
The unconventional but previously valid call signature | ||
``plot(xs, ys, 'ro', zs=zs)`` is no longer supported. | ||
Parameters | ||
---------- | ||
zdir : {'x', 'y', 'z'}, default: 'z' | ||
When plotting 2D data, the direction to use as z. | ||
axlim_clip : bool, default: False | ||
Whether to hide data that is outside the axes view limits. | ||
data : indexable object, optional | ||
DATA_PARAMETER_PLACEHOLDER | ||
**kwargs | ||
Other arguments are forwarded to'Axes.plot'. | ||
Comment on lines -1971 to +1993 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Um, you've significantly mixed up the docstring:
Please take more care when submitting changes. These are all aspects that you should have been able to detect yourself and not something we should be spending valuable reviewer time on. | ||
""" | ||
had_data = self.has_data() | ||
xs, ys, zs = cbook._broadcast_with_masks(xs, ys, zs) | ||
if fmt is not None: | ||
lines = super().plot(xs, ys, fmt, **kwargs) | ||
else: | ||
lines = super().plot(xs, ys, **kwargs) | ||
for line in lines: | ||
art3d.line_2d_to_3d(line, zs=zs, zdir=zdir, axlim_clip=axlim_clip) | ||
@@ -4042,7 +4043,7 @@ def stem(self, x, y, z, *, linefmt='C0-', markerfmt='C0o', basefmt='C3-', | ||
linestyle = mpl._val_or_rc(linestyle, 'lines.linestyle') | ||
# Plot everything in required order. | ||
baseline, = self.plot(basex, basey, zs=bottom, fmt=basefmt, | ||
zdir=orientation, label='_nolegend_') | ||
stemlines = art3d.Line3DCollection( | ||
lines, linestyles=linestyle, colors=linecolor, label='_nolegend_', | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -346,9 +346,19 @@ | ||
@check_figures_equal() | ||
def test_plot_scalar(fig_test, fig_ref): | ||
ax1 = fig_test.add_subplot(projection='3d') | ||
ax1.plot([1], [1], [1], "o") | ||
timhoffm marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
ax1.plot([2], [2], "o") | ||
ax2 = fig_ref.add_subplot(projection='3d') | ||
ax2.plot(1, 1, 1, "o") | ||
ax2.plot(2, 2, 0, "o") | ||
@check_figures_equal() | ||
def test_plot_data(fig_test, fig_ref): | ||
ax1 = fig_test.add_subplot(projection='3d') | ||
ax1.plot([1, 2, 3], [4, 5, 6], [7, 8, 9]) | ||
ax2 = fig_ref.add_subplot(projection='3d') | ||
ax2.plot([1, 2, 3], [4, 5, 6], [7, 8, 9]) | ||
def test_invalid_line_data(): | ||
Uh oh!
There was an error while loading.Please reload this page.