I finally solved it my self, after half a day of headbanging. This did the trick for me, it is really good since it uses the values of the lower x axis, so you do not have to go in fiddle with ticklabels etc, it also changes values when you pan/zoom etc.
fig = pl.figure(1,figsize=(10.5,8)) fig.clf() ax_kms = fig.add_subplot(111) ax_kms.step(velocity, spect) ax_hz = ax_kms.twiny() x_1, x_2 = ax_kms.get_xlim() ax_hz.set_xlim(calc_frequency(x_1,data.restfreq/1e9), calc_frequency(x_2,data.restfreq/1e9)) Great! -- View this message in context: http://old.nabble.com/Twiny-and-affine-transform-for-xlim-tp29032627p29041680.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users