Tony S Yu wrote: > On Jun 30, 2008, at 10:22 AM, Nihat wrote: > >> ax = gca() >> (x_screen, y_screen) = ax.transData.transform([x[10], y[10]) >> (x10, y10) = ax.transAxes.inverted().transform([x_screen, y_screen]) >> >> Is it the proper way of doing it? Where can I find more info on >> transformations in general? >> > > I'd really be interested to know the answer to this question, too. I > recently wanted to do this exact same transformation. When I tried > > >>> (x10, y10) = ax.transLimits.transform([x[10], y[10]) > > I got the desired input for *linear* data. Looking looking at the > definitions of the axes transforms in the code (Axes class in axes.py) > you see that: > > >>> self.transData = self.transScale + (self.transLimits + > self.transAxes) > > where `self` is the Axes object. It would seem that your sequence of > operations (`transData.transform` followed by > `transAxes.inverted().transform`) should be equivalent to: > > >>> transDesired = self.transScale + self.transLimits > > But, when I tried using this transform, I didn't get the desired > transformation for logarithmic data. > > Any transform experts out there? > transScale is where all of the (optionally) logarithmic transformation takes place. I'm surprised
>>> transDesired = self.transScale + self.transLimits didn't work for going from data to a (0, 0) - (1, 1) bounding box. Can you provide a small, yet complete, example that illustrates the bug so I can look at it further? Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users