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 b5149fd

Browse filesBrowse files
authored
Merge pull request #25830 from scottshambaugh/3d_axis_positions
Specify ticks and axis label positions for 3D plots
2 parents 950d0db + 724e80c commit b5149fd
Copy full SHA for b5149fd

File tree

Expand file treeCollapse file tree

4 files changed

+275
-96
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+275
-96
lines changed
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Specify ticks and axis label positions for 3D plots
2+
---------------------------------------------------
3+
4+
You can now specify the positions of ticks and axis labels for 3D plots.
5+
6+
.. plot::
7+
:include-source:
8+
9+
import matplotlib.pyplot as plt
10+
11+
positions = ['lower', 'upper', 'default', 'both', 'none']
12+
fig, axs = plt.subplots(2, 3, figsize=(12, 8),
13+
subplot_kw={'projection': '3d'})
14+
for ax, pos in zip(axs.flatten(), positions):
15+
for axis in ax.xaxis, ax.yaxis, ax.zaxis:
16+
axis.set_label_position(pos)
17+
axis.set_ticks_position(pos)
18+
title = f'position="{pos}"'
19+
ax.set(xlabel='x', ylabel='y', zlabel='z', title=title)
20+
axs[1, 2].axis('off')

0 commit comments

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