Feed on
Posts
Comments

to move your x-axis label to the top of the figure:

ax.xaxis.tick_top()


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

2 Responses to “move x-axis label to top of figure in matplotlib”

  1. on 11 Aug 2015 at 7:01 pm Demis

    This moves the ticks only.
    To move the label as well, it looks like you need to do:
    `ax.xaxis.set_label_position(“top”)`

  2. on 11 Aug 2015 at 7:03 pm Demis

    Sorry, yours does move the tick labels. What I added was to move the Axis label.
    Either way, thanks for posting it!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.