Hmm, after a little more work it seems that the problem is actually
with the 'clabel' command. To expand on Eric's example,

x = arange(5)
y = arange(7)
X, Y = meshgrid(x,y)
z = X+Y
c=contour(X, Y, z, [5])
clabel(c, inline=1)

(causes exceptions in a fresh ipython session)

clabel causes problems if only a single contour level is specified and returned.

Maybe this is a bug?

Kind regards,

Brendan

On Wed, Nov 4, 2009 at 6:01 PM, Eric Firing <efir...@hawaii.edu> wrote:
> John Hunter wrote:
>>
>> On Wed, Nov 4, 2009 at 11:16 AM, Brendan Arnold <brendanarn...@gmail.com>
>> wrote:
>>>
>>> Ah, I was a little confused by what you wrote John (I though I had to
>>> access contour through the axes object and the meaning of R, F, dR was
>>> a little unclear..) however using the 'levels' keyword now works. i.e.
>>>
>>> plt.contour(x, y, z, levels=[0])
>>>
>>> Incidentally, this keyword (levels) is not documented at
>>>
>>> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour
>>> and in fact the documentation implies that contour(kx, ky, z, [0])
>>> should work when it does not.
>
> But it does work, as it should:
>
> x = arange(5)
> y = arange(7)
> X, Y = meshgrid(x,y)
> z = X+Y
> contour(X, Y, z, [5])
>
>
> Drop the above into "ipython -pylab".
>
> Eric
>
>>>
>>> Perhaps the docs could be updated to reflect this?
>>
>> Thanks for the heads up -- I updated the docstring in svn HEAD
>>
>> Sorry the original example was confusing -- I cut and pasted from some
>> code I was working on, and forgot to import the mindreading module
>>
>> JDH
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day trial. Simplify your report design, integration and deployment - and
>> focus on what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to