## matplotlib-users

 [Matplotlib-users] twinx() multiple x-axes? From: Matthew Czesarski - 2007-03-21 17:18:13 Attachments: Message as HTML ```Hi matplotlib-users! OK, yeah, I'm pretty new to matplotlib/pylab... I played with biggles for a short while but, all (more than 3) my python-using associates in the astronomical community we saying matplotlib was the way of the future... So I started with matplotlib. I would like to plot some points, y vs x on a graph. y containing simple values, x is an angle. plot(x, y) -- that bit is fine, values as a function of angle. But what I need to do is then have an another labelling scheme on the upper x axes. This would be say, a distance, and so is simply a constant multiplied by the lower x. I figured there would be some way I could rescale the x-axis and write it at the top, but a way of accomplishing this I cannot find. I have been playing with twinx a bit but not getting very far. It's not that I want to plot 2 different datasets because the two are equivalent. Is it the non-existnt twiny() I am looking for? Or is there simply a way to redraw axes over the current ones with a certain range, that leaves the range in the first plot untouched? I have messed with twinx a bit and some of the discussion in the archive for this list but I can't figure out how to do it... Hope that makes sense? Sorry my first post was a beg for help Matt ```
 Re: [Matplotlib-users] twinx() multiple x-axes? From: Richard Albright - 2007-03-21 20:42:33 ```use tick top: ax = twinx() ax.xaxis.tick_top() On Wed, 2007-03-21 at 18:17 +0100, Matthew Czesarski wrote: > Hi matplotlib-users! > > OK, yeah, I'm pretty new to matplotlib/pylab... I played with biggles > for a short while but, all (more than 3) my python-using associates in > the astronomical community we saying matplotlib was the way of the > future... So I started with matplotlib. > > I would like to plot some points, y vs x on a graph. y containing > simple values, x is an angle. plot(x, y) -- that bit is fine, values > as a function of angle. But what I need to do is then have an another > labelling scheme on the upper x axes. This would be say, a distance, > and so is simply a constant multiplied by the lower x. I figured there > would be some way I could rescale the x-axis and write it at the top, > but a way of accomplishing this I cannot find. > > I have been playing with twinx a bit but not getting very far. It's > not that I want to plot 2 different datasets because the two are > equivalent. Is it the non-existnt twiny() I am looking for? Or is > there simply a way to redraw axes over the current ones with a certain > range, that leaves the range in the first plot untouched? I have > messed with twinx a bit and some of the discussion in the archive for > this list but I can't figure out how to do it... > > Hope that makes sense? Sorry my first post was a beg for help > Matt > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ Matplotlib-users mailing list Matplotlib-users@... https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Rick Albright Senior Quantitative Analyst Indie Research, LLC 254 Witherspoon Street Princeton, NJ 08542 (609)497-1030 ralbright@... ```