SyntaxFix
Write A Post
Hire A Developer
Questions
You want set_ticks_position rather than set_label_position:
set_ticks_position
set_label_position
ax.xaxis.set_ticks_position('top') # the rest is the same
This gives me: