On 12/05/2011 10:00 AM, Arnaud wrote:
> Hello,
>
> I am new to this list, but not totally to matplotlib.
> I installed v1.1.0 lately, and i noticed that something went wrong (or,
> not as before) with fcontour().
> It looks like the range of colors used to fill in, is not set correctly.
> Sorry, i cannot really tel it better, but i have a piece of source code,
> that highlights the phenomenon :

Try removing the call to contour; it is not doing you any good, at least 
in this example. You are passing its ContourSet return object to your 
colorbar call, so your colorbar is showing the contour lines, not the 
continuous range of colors, which I think is what you want.

You can show both contourf colors and contour lines on a colorbar, if 
you do want that; see
http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html

Eric

>
> #!/usr/bin/python
> import os
> import sys
> from pylab import *
>
> # parameters we bach on
> x = linspace(-10,10,30)
> y = linspace(-4,4,30)
> X,Y = meshgrid(x,y)
> F = 0.5*X**2 + (7*Y**2)/2
>
> fig = figure(num=None, figsize=(6, 6), dpi=80, facecolor='#666666',
> edgecolor='k')
>
> ax = fig.gca()
>
> cmap=get_cmap('reds')
> plage = arange(0,100,1)
> surf = contourf(X,Y,F, plage)
> plage = arange(0,100,2)
> surf = contour(X,Y,F, plage, linewidths=2)
>
> ax.grid(True)
> fig.colorbar(surf, shrink=0.5, aspect=5)
> axis([x.min(),x.max(),y.min(),y.max()])
>
> show()
>
>
> I ran it with pyV2.6/matplotlibV0.99.1, and it behaves differently with
> pyV2.7/matplotlibV1.1.0 .
>
> Could you confirm that on your computer, if this is an expected
> behaviour, and, if not, if you have an idea about how to fix it ?
>
> thanks a lot,
> Arnaud.
>
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to