Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa2a0d6

Browse filesBrowse files
authored
Merge pull request #10728 from jinshifen33/bugfix-for-issue-5742
Set data limits for Axes3DSubplot.plot when zdir=y or zdir=x #5742
2 parents c85b029 + d37407c commit fa2a0d6
Copy full SHA for fa2a0d6

File tree

Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,7 @@ def plot(self, xs, ys, *args, **kwargs):
15681568
for line in lines:
15691569
art3d.line_2d_to_3d(line, zs=zs, zdir=zdir)
15701570

1571+
xs, ys, zs = art3d.juggle_axes(xs, ys, zs, zdir)
15711572
self.auto_scale_xyz(xs, ys, zs, had_data)
15721573
return lines
15731574

Loading

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ def test_scatter3d_color():
175175
color='b', marker='s')
176176

177177

178+
@image_comparison(baseline_images=['plot_3d_from_2d'], remove_text=True,
179+
extensions=['png'])
180+
def test_plot_3d_from_2d():
181+
fig = plt.figure()
182+
ax = fig.add_subplot(111, projection='3d')
183+
xs = np.arange(0, 5)
184+
ys = np.arange(5, 10)
185+
ax.plot(xs, ys, zs=0, zdir='x')
186+
ax.plot(xs, ys, zs=0, zdir='y')
187+
188+
178189
@image_comparison(baseline_images=['surface3d'], remove_text=True)
179190
def test_surface3d():
180191
fig = plt.figure()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.