[Matplotlib-users] Clabel conflicts with contourf

2014-01-30 Thread Alexis Praga
Hi, 

I've attached a reproducible example : when clabel is used, there are some 
empty (i.e white) triangles in the countour.
It does not occur without clabel.

Tested with matplotlib 1.2.0, python 2.7 on Fedora 14, 64 bits.

Cheers,

-- 
Alexis Praga, PhD Student (CERFACS)
GPG key : AD4A AF6D BB5C 042F 9422  1223 06E1 C1BF E287 65D0 
import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

deltax = 0.025
deltay = 0.01
x = np.arange(-np.pi, np.pi, deltax)
y = np.arange(-np.pi*0.5, np.pi*0.5, deltay)
X, Y = np.meshgrid(x, y)
centerx= np.pi*0.5
centery= np.pi*0.5
Z = [[np.cos(curx-centerx)*np.cos((cury-centery)) for curx in x] for cury in y]

plt.figure()
CS = plt.contourf(X, Y, Z,levels=np.arange(-1,1.1,0.1))
plt.colorbar(CS)
plt.clabel(CS, inline=1, fontsize=10)
plt.show()


signature.asc
Description: Digital signature
--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Clabel conflicts with contourf

2014-01-30 Thread Eric Firing
On 2014/01/30 1:10 AM, Alexis Praga wrote:
> Hi,
>
> I've attached a reproducible example : when clabel is used, there are some 
> empty (i.e white) triangles in the countour.
> It does not occur without clabel.

Thanks for the report--but clabel is intended to be used only with 
contour, not with contourf.  Typically one would call contourf, and then 
call contour, perhaps with a subset of the levels used in contourf.  The 
ContourSet resulting from the contour call would then be used in the 
call to clabel.  Example:

http://matplotlib.org/examples/pylab_examples/contourf_demo.html

In this example the contour lines are black, but if you don't want the 
lines to show up at all, you could make them transparent, and then 
include a "colors" kwarg in the clabel call.

Eric

>
> Tested with matplotlib 1.2.0, python 2.7 on Fedora 14, 64 bits.
>
> Cheers,
>



--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting NOAA grib2 data in basemap

2014-01-30 Thread A Short
Thanks Eric and Kio - ive been trying for a couple of days and i just cant
seem to get my head around the interpolation or masked arrays. Would it be
possible for anyone to give me a few pointers on where to start editing the
script.

Ive tried digesting these tutorials the first one seems to be relevant to
what im trying to achieve by using a Laplace filter but im still having
trouble installing all the modules to be able to play with it more 

http://www.trondkristiansen.com/?page_id=846
  

http://www.geophysique.be/2010/05/05/matplotlib-basemap-tutorial-part-03-masked-arrays-zoom/

  

And reading all of the toolkit docseveral times!

Thanks again



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42805.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users