[Matplotlib-devel] Use of contourf changed?

Benjamin Root ben.v.root at gmail.com
Thu Nov 12 11:09:54 EST 2015


Interesting, but it is hard to tell what is going on without any code or
data. In particular, matplotlib's contourf polygons has always been
"unstacked". In other words, the polygons representing a contour level does
not overlap with any other polygon of another contour level, so I am not
exactly sure how you are getting the behavior you are seeing in either
image.

Now, the default algorithm for contouring did change in v1.5. You can
access the old algorithm by passing `corner_mask='legacy'` as a keyword
argument to contourf() in v1.5. Could you try that and see if at least you
get identical results for v1.5 and v1.4?  Note, that keyword argument is
not available in v1.4. This should help us narrow down the source of your
issue, but I wouldn't treat it as a solution because the old algorithm is
slated for removal at some point, and it still doesn't explain the
difference you are seeing with the new contouring algorithm.

Ben


On Thu, Nov 12, 2015 at 8:11 AM, Viktoria Schubert via Matplotlib-devel <
matplotlib-devel at python.org> wrote:

> Hello together,
>
> Since the 1.5 version of matplotlib together with python 3.5, I get
> strange results from using the contourf function. What I'm actually
> doing is plotting a lot of points in a 2D-space. The density equals the
> likelihood of the data, so what I want is to plot the 1Sigma, 2Sigma and
> 3Sigma areas of the data.
> For this purpose, I was using the following line of code:
> cs = plt.contourf(hist2D, extent=extent, levels=[L1,L2,L3,Lmin],
> linestyles=['-','-','-','-'], colors=['blue','blue','blue'], alpha=0.25)
>
> The problem now is, that with matplotlib 1.4, the resulting image shows
> the most dense area in white instead of darker blue, which was the
> previous behavior. I did not change my code, I can get the old result
> simply by moving back to 1.4.
> I link to the two pictures I created, so maybe one of you can explain
> me, what changed with the version so that the plot is getting messed up.
> V1.4:
> http://i.imgur.com/HH7jKBE.png
> V1.5:
> http://i.imgur.com/0LZ9Tso.png
>
> Thank you very much,
> Viktoria
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20151112/bb54944e/attachment.html>


More information about the Matplotlib-devel mailing list