1

I want to create two x-axes, one below the other.

I believe I want to base it off this example (which looks like this), but in particular how do I draw this outside (below) the original axes region, and set major_ticks and major_ticklabels?

3
  • Do you want them to be independent of each other, or linked? (i.e. are you wanting to show, say, one x-axis for meters and one for feet, but plot the same data, or are you wanting to plot two different datasets with the same y-axis, but independent x-axes?) Commented Oct 12, 2011 at 18:44
  • @Joe, thanks -- I would like to know both ways, actually. In R for instance, you can just "draw" an axis and it doesn't necessarily have to be linked to anything. Is that possible in matplotlib? Commented Oct 13, 2011 at 16:01
  • It is, but generally (even in R) you choose whether you want things to zoom in when you zoom in on the other axis, etc. Usually you want it linked in some way, and there are multiple ways to link things, which is why I asked. Commented Oct 13, 2011 at 16:25

1 Answer 1

1

This example, http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html shows how to move the spines outwards. The rest depends on what sort of relation do you want of your x-spines (do you want them linked or do you want them independent of each other).

Sign up to request clarification or add additional context in comments.

1 Comment

This opens up a whole new world for me. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.