[Matplotlib-devel] Use of contourf changed?

Viktoria Schubert schubert.viktoria at googlemail.com
Thu Nov 12 08:11:45 EST 2015


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


More information about the Matplotlib-devel mailing list