8000 Specify ticks and axis label positions for 3D plots by scottshambaugh · Pull Request #25830 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Specify ticks and axis label positions for 3D plots #25830

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions doc/users/next_whats_new/3d_axis_positions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Specify ticks and axis label positions for 3D plots
---------------------------------------------------

You can now specify the positions of ticks and axis labels for 3D plots.

.. plot::
:include-source:

import matplotlib.pyplot as plt

positions = ['lower', 'upper', 'default', 'both', 'none']
fig, axs = plt.subplots(2, 3, figsize=(12, 8),
subplot_kw={'projection': '3d'})
for ax, pos in zip(axs.flatten(), positions):
for axis in ax.xaxis, ax.yaxis, ax.zaxis:
axis.set_label_position(pos)
axis.set_ticks_position(pos)
title = f'position="{pos}"'
ax.set(xlabel='x', ylabel='y', zlabel='z', title=title)
axs[1, 2].axis('off')
Loading
0