Description
Bug report
Bug summary
Calling Tick.apply_tickdir does not update the tick's direction.
Code for reproduction
fig, ax = plt.subplots()
fig.canvas.draw() # ensure ticks are updated
ax.xaxis.majorTicks[1].apply_tickdir("inout")
plt.show()
Actual outcome
Last line has no effect.
Expected outcome
2nd major x tick should be "inout".
This has actually likely never worked (at least as far back as mpl2.0), because Tick.apply_tickdir
updates _tickmarkers
but these only get applied to the actual Line2D object used to draw ticks in Tick._apply_params
. So really apply_tickdirs
should be considered a private helper for Tick._apply_params
(which calls apply_tickdirs, and then applies the new _tickmarks to the Line2Ds), which is itself a helper for the public
Axis.set_tick_params`.
So the solution is either to make Tick.apply_tickdir
private, or possibly turn it into a public Tick.set_tickdir
(following standard naming) which does actually update the Line2D.
Matplotlib version
- Operating system: fedora
- Matplotlib version: master
- Matplotlib backend (
print(matplotlib.get_backend())
): any - Python version: 38
- Jupyter version (if applicable):
- Other libraries: