SourceForge logo
SourceForge logo
Menu

matplotlib-users

This is a bug report.
I am using matplotlib 0.99.1 on Windows. When using contour with the
keyword
argument locator=ticker.FixedLocator(levels), the plot is always dropping
the first
and last contour level. If there are less than 3 levels, contour.py throws
an
exception.
My workaround is to duplicate the first and last levels when using the fixed
locator:
e.g. my argument becomes
 locator=FixedLocator( [levels[0]] + levels + [levels[-1]] )
I have traced the problem to the last line in contour.py, method _autolev()
which
strips the first and last levels if the contours are not filled:
 return lev[1:-1]
This line occurs at line 682 in my version of contour.py which came with the
0.991 installation.
I realize that I could specify the levels in the argument V and this does
work. However
this code is embedded in GUI-ness which allows the user to choose how the
contours
are selected. Passing the locator seems to be the best option code-wise.
Thank you,
Dave Smith
David Smith wrote:
> This is a bug report.
> 
> I am using matplotlib 0.99.1 on Windows. When using contour with the 
> keyword
> argument locator=ticker.FixedLocator(levels), the plot is always 
> dropping the first
> and last contour level. If there are less than 3 levels, contour.py 
> throws an
> exception.
> 
> My workaround is to duplicate the first and last levels when using the 
> fixed locator: 
> e.g. my argument becomes
> 
> locator=FixedLocator( [levels[0]] + levels + [levels[-1]] )
> 
> I have traced the problem to the last line in contour.py, method 
> _autolev() which
> strips the first and last levels if the contours are not filled:
> 
> return lev[1:-1]
> 
> This line occurs at line 682 in my version of contour.py which came with 
> the 0.991 installation.
> 
> I realize that I could specify the levels in the argument V and this 
> does work. However
> this code is embedded in GUI-ness which allows the user to choose how 
> the contours
> are selected. Passing the locator seems to be the best option code-wise.
I committed a small change to svn trunk (r8190) that I think will handle 
your use case without fouling anything else up.
Eric
> 
> Thank you,
> 
> Dave Smith
> 
Eric,
 Thank you, thank you, thank you. This not only fixes the problem I
reported with with
FixedLocator(..) but also another one where I was using MultipleLocator(..)
and getting
the same problem issue with dropping first and last contours. The later
isn't as easy
to work-around but your change fixed it.
David Smith
On Sat, Mar 13, 2010 at 12:30 PM, Eric Firing <ef...@ha...> wrote:
> David Smith wrote:
>
>> This is a bug report.
>>
>> I am using matplotlib 0.99.1 on Windows. When using contour with the
>> keyword
>> argument locator=ticker.FixedLocator(levels), the plot is always dropping
>> the first
>> and last contour level. If there are less than 3 levels, contour.py
>> throws an
>> exception.
>>
>> My workaround is to duplicate the first and last levels when using the
>> fixed locator: e.g. my argument becomes
>>
>> locator=FixedLocator( [levels[0]] + levels + [levels[-1]] )
>>
>> I have traced the problem to the last line in contour.py, method
>> _autolev() which
>> strips the first and last levels if the contours are not filled:
>>
>> return lev[1:-1]
>>
>> This line occurs at line 682 in my version of contour.py which came with
>> the 0.991 installation.
>>
>> I realize that I could specify the levels in the argument V and this does
>> work. However
>> this code is embedded in GUI-ness which allows the user to choose how the
>> contours
>> are selected. Passing the locator seems to be the best option code-wise.
>>
>
> I committed a small change to svn trunk (r8190) that I think will handle
> your use case without fouling anything else up.
>
> Eric
>
>
>> Thank you,
>>
>> Dave Smith
>>
>>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /