-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Community supportUsers in need of help.Users in need of help.
Description
Bug summary
When setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels.
Code for reproduction
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(range(2020, 2025),
range(-2, 3))
ax.spines['top'].set_position('zero')
ax.spines['bottom'].set_visible(False)
ax.tick_params(labelbottom=True, labeltop=False, bottom=False, top=True)
ax.spines['top'].axis.set_tick_params(length=10)
ax.set_xticks(range(2020, 2025))
plt.show()
Actual outcome
Expected outcome
Additional information
No response
Operating system
Windows
Matplotlib Version
3.3.4
Matplotlib Backend
TkAgg
Python version
3.6.13
Jupyter version
No response
Installation
pip
Metadata
Metadata
Assignees
Labels
Community supportUsers in need of help.Users in need of help.