Mike,
Thanks for the help. It worked. I have another question but I will send it
as a new thread.
Nihat
On Mon, Jun 30, 2008 at 12:02 PM, Michael Droettboom <[EMAIL PROTECTED]>
wrote:
>
>
> Tony S Yu wrote:
>
>>
>> On Jun 30, 2008, at 11:13 AM, Michael Droettboom wrote:
>>
>>> 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?
>>>
>>
>> I tried to put together a simple example showing my problem, but the
>> example worked properly! Doh!
>>
>> It turns out that my problem was specific to using a bounding box as an
>> input to transform:
>>
>> =========
>> from numpy.random import rand
>> import matplotlib.pyplot as plt
>>
>> ax = plt.subplot(111)
>> xy = rand(5,2)
>> ax.loglog(xy[:, 0], xy[:, 1], 'ro')
>>
>> trans = ax.transScale + ax.transLimits
>> result = trans.transform(ax.dataLim) =========
>>
>> The above command gives me:
>> * TypeError:* 'Bbox' object is unsubscriptable
>> (Note, if I call `plot` instead of `loglog` I don't have problems). The
>> quick solution is to replace the last line with
>>
>> >>> result = trans.transform(ax.dataLim._points)
>>
>> I guess I was confused because the transform worked fine with `plot`. Is
>> the TypeError above expected behavior?
>>
>> Yes. The "transform" method is meant to take an Nx2 array, it doesn't
> take a bounding box. I think it probably works with non-log plots only by
> accident because bounding boxes can cast to arrays in some cases. It may be
> worth taking that out to avoid confusion, but I'll have to think on it some.
>
> Thanks for looking into this!
>
>
> Mike
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users