You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Setting ticks marks on a single spine doesn't work properly #25117
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.
I don't think the tick parameters are customizable between the top and bottom spines; note that ax.spines['top'].axis is the same object as ax.spines['bottom'].axis.
If you want a different spine in the middle of your figure with no labels, you could try using ax.secondary_xaxis (https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.secondary_xaxis.html). It should be completely configurable independent of the main x-axis. The only issue is that I don't know that you can pin secondary_xaxis to a data value (eg. 0). versus a location on the axes (eg. 0.5)
Activity
jklymak commentedon Jan 31, 2023
I don't think the tick parameters are customizable between the top and bottom spines; note that
ax.spines['top'].axisis the same object asax.spines['bottom'].axis.If you want a different spine in the middle of your figure with no labels, you could try using
ax.secondary_xaxis(https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.secondary_xaxis.html). It should be completely configurable independent of the main x-axis. The only issue is that I don't know that you can pin secondary_xaxis to a data value (eg. 0). versus a location on the axes (eg. 0.5)WWakker commentedon Jan 31, 2023
Okay thanks a lot for clarifying. I could solve the problem completely like this:
Closing the issue.
jklymak commentedon Jan 31, 2023
Slight follow up in #25119 - would be nice to be able to place the secondary axes in data co-ordinates