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
My workaround is to duplicate the first and last levels when using the fixed locator:
e.g. my argument becomes
locator=FixedLocator( [levels] + 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:
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.