8000 Merge pull request #25830 from scottshambaugh/3d_axis_positions · matplotlib/matplotlib@b5149fd · GitHub
[go: up one dir, main page]

Skip to content

Commit b5149fd

Browse 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

File tree

4 files changed

+275
-96
lines changed

4 files changed

+275
-96
lines changed
Lines 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