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 8953596

Browse filesBrowse files
author
Yi Wei
committed
FIX: Axis offset mispositioning in plot_surface
1 parent 0b8bd96 commit 8953596
Copy full SHA for 8953596

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+16
-0
lines changed

‎lib/mpl_toolkits/mplot3d/axis3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axis3d.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def draw_pane(self, renderer):
323323
@artist.allow_rasterization
324324
def draw(self, renderer):
325325
self.label._transform = self.axes.transData
326+
self.offsetText._transform = self.axes.transData
326327
renderer.open_group("axis3d", gid=self.get_gid())
327328

328329
ticks = self._update_ticks()

‎lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/tests/test_axes3d.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,21 @@ def test_surface3d():
588588
fig.colorbar(surf, shrink=0.5, aspect=5)
589589

590590

591+
@image_comparison(['surface3d_label_offset_tick_position.png'], style='mpl20')
592+
def test_surface3d_label_offset_tick_position():
593+
ax = plt.figure().add_subplot(projection="3d")
594+
595+
x, y = np.mgrid[0:6 * np.pi:0.25, 0:4 * np.pi:0.25]
596+
z = np.sqrt(np.abs(np.cos(x) + np.cos(y)))
597+
598+
ax.plot_surface(x * 1e5, y * 1e6, z * 1e8, cmap='autumn', cstride=2, rstride=2)
599+
ax.set_xlabel("X label")
600+
ax.set_ylabel("Y label")
601+
ax.set_zlabel("Z label")
602+
603+
ax.figure.canvas.draw()
604+
605+
591606
@mpl3d_image_comparison(['surface3d_shaded.png'], style='mpl20')
592607
def test_surface3d_shaded():
593608
fig = plt.figure()

0 commit comments

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