Description
Bug summary
I expected tick_top
to add ticks on the top of the uppermost subplot when using sharex=True
. However, it adds ticks to the lower subplot (as it would normally), making it incompatible with shared axes.
Code for reproduction
import matplotlib.pyplot as plt
fig, axes = plt.subplots(
sharex=True, sharey=True,
ncols=2, nrows=2
)
axes = axes.flatten()
for ax in axes:
sc = ax.scatter(
x=[0, 1, 5, 3],
y=[0, 1, 2, 4],
)
ax.xaxis.tick_top()
ax.tick_params(axis='x', rotation=55)
Actual outcome
Expected outcome
Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.8.2
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
conda