axis on top for barh plot


How can I put the bottom axis on top (or on top AND on bottom) for a barh plot?

It's somewhat counter-intuitive, but it can be done.
You have to create some "twin" axes with the "twiny" option,
then make the plot on the twin axes so it will use the
top axis. The bottom axis still have to be adjusted manually
to make it match the top one and remove the labels.

See this example:

Thanks for your example. With your help I was able to finally create this with matplotlib,
and this is my final script,

One thing that surprised me was to shrink the font for the names required changing ax1 even though the barh plot is on ax2. See these lines:


  ax2.barh(pos, listUse, color=listColors, height=1.0, align='center')
  for tick in ax1.yaxis.get_major_ticks():