[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] Documentation

2012-05-02 Thread Alexis Praga
Here is the result of "apt-get build-dep python-matplotlib" :

The following NEW packages will be installed:
  blt debhelper doc-base docbook-xsl docbook-xsl-doc-html dvipng
global graphviz html2text intltool-debian ipython javascript-common
libatk1.0-dev libcairo2-dev libcgraph5 libfreezethaw-perl
  libgtk2.0-dev libgvpr1 libjs-jquery libmail-sendmail-perl
libmldbm-perl libpango1.0-dev libphonon4 libpixman-1-dev
libqt4-assistant libqt4-help libqt4-scripttools libqt4-svg libqt4-test
libqt4-webkit
  libqt4-xmlpatterns libsys-hostname-long-perl libwxbase2.8-dbg
libwxgtk2.8-dbg libxcb-render-util0-dev libxcb-render0-dev
libxcomposite-dev libxcursor-dev libxdamage-dev libxfixes-dev
libxi-dev
  libxrandr-dev libxss-dev po-debconf preview-latex-style python-all
python-all-dbg python-all-dev python-apptools python-dateutil
python-dbg python-docutils python-enthoughtbase python-epydoc
  python-foolscap python-gobject-dev python-gtk2-dev python-gtk2-doc
python-jinja2 python-lxml python-numpy-dbg python-pygments
python-qt-dev python-qt4 python-qt4-dev python-roman python-setuptools
  python-sip python-sip-dev python-sphinx python-tk python-traits
python-twisted-names python-tz python-wxgtk2.8 python-wxgtk2.8-dbg
python-wxversion python2.5 python2.5-dbg python2.5-dev
  python2.5-minimal python2.6-dbg tcl8.5-dev texlive-fonts-recommended
texlive-fonts-recommended-doc texlive-latex-extra
texlive-latex-extra-doc texlive-pictures texlive-pictures-doc texpower
  texpower-manual tipa tk8.5-dev wwwconfig-common wx2.8-headers
x11proto-composite-dev x11proto-damage-dev x11proto-fixes-dev
x11proto-randr-dev x11proto-scrnsaver-dev
0 upgraded, 100 newly installed, 0 to remove and 2 not upgraded.
Need to get 298 MB/369 MB of archives.
After this operation, 818 MB of additional disk space will be used.

Now, with "apt-rdepends python-matplotlib | head -n 24", I can have
the "true" dependencies :
python-matplotlib
  Depends: libatk1.0-0 (>= 1.29.3)
  Depends: libc6 (>= 2.3.6-6~)
  Depends: libcairo2 (>= 1.2.4)
  Depends: libfontconfig1 (>= 2.8.0)
  Depends: libfreetype6 (>= 2.2.1)
  Depends: libgcc1 (>= 1:4.1.1)
  Depends: libglib2.0-0 (>= 2.16.0)
  Depends: libgtk2.0-0 (>= 2.8.0)
  Depends: libpango1.0-0 (>= 1.14.0)
  Depends: libpng12-0 (>= 1.2.13-4)
  Depends: libstdc++6 (>= 4.4.0)
  Depends: python (>= 2.5)
  Depends: python-cairo
  Depends: python-dateutil
  Depends: python-gobject
  Depends: python-matplotlib-data (>= 0.99.3-1)
  Depends: python-numpy (>= 1:1.3.0)
  Depends: python-pyparsing
  Depends: python-support (>= 0.90.0)
  Depends: python-tz
  Depends: tcl8.5 (>= 8.5.0)
  Depends: tk8.5 (>= 8.5.0)
  Depends: zlib1g (>= 1:1.1.4)

-- 

Alexis Praga

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Documentation

2012-05-01 Thread Alexis Praga
Actually, you will still need "python-dev" for compiling.

Sorry.

On Tue, May 1, 2012 at 5:21 PM, Alexis Praga  wrote:
> Hi,
>
> The documention on building matplotlib from source (
> http://matplotlib.sourceforge.net/users/installing.html )
> says the following :
>
> "If you are on debian/ubuntu, you can get all the dependencies
> required to build matplotlib with:
> sudo apt-get build-dep python-matplotlib"
>
> However, doing so will force use to install over 800Mo of useless packages.
> The dependencies mentioned after that (pytvhon,numpy, libpng,
> freetype) are sufficient for building from source.
> Could you edit that ?
>
>
> Thanks
>
> --
> Alexis Praga

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Documentation

2012-05-01 Thread Alexis Praga
Hi,

The documention on building matplotlib from source (
http://matplotlib.sourceforge.net/users/installing.html )
says the following :

"If you are on debian/ubuntu, you can get all the dependencies
required to build matplotlib with:
sudo apt-get build-dep python-matplotlib"

However, doing so will force use to install over 800Mo of useless packages.
The dependencies mentioned after that (pytvhon,numpy, libpng,
freetype) are sufficient for building from source.
Could you edit that ?


Thanks

--
Alexis Praga

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Display problem on CentOS

2012-03-27 Thread Alexis Praga
You can check you are editing the correct configuration file with (in
the Python shell) :
>>> import matplotlib
>>> matplotlib.matplotlib_fname()

You can also try other backends. For a list, see :
http://matplotlib.sourceforge.net/faq/usage_faq.html#what-is-a-backend

On Tue, Mar 27, 2012 at 2:46 PM, Magician  wrote:
> Thank you, Alexis.
>
> I try to install PyQt4 and set Qt4Agg just now, but nothing displayed.
> Ummm...what's wrong...??
>
>
> Magician
>
>
> On 2012/03/27, at 17:05, Alexis Praga wrote:
>
>> I had the same problem on Debian.
>> Editing the matplotlibrc (should be installed somewhere in your
>> systeme) and changing the "backend" variable to Qt4Agg did the trick.
>>
>>
>>
>> On Tue, Mar 27, 2012 at 12:14 AM, Magician  wrote:
>>> Hi.
>>>
>>> I want to install Matplotlib from source code on CentOS.
>>> I've been using Matplotlib for a year.
>>> But this is the first time for me to install CentOS by myself.
>>>
>>> I installed CentOS 6.2 in basic install option.
>>> Next, I installed NumPy and Matplotlib.
>>> .matplotlibrc isn't set.
>>>
>>> It looks successfully installed, but when I type show() command,
>>> nothing appears.
>>> I can export PNG image by using savefig() command, so maybe
>>> I'm using invalid backend.
>>>
>>> How can I display plots with show() command?
>>>
>>>
>>> Magician
>

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Display problem on CentOS

2012-03-27 Thread Alexis Praga
I had the same problem on Debian.
Editing the matplotlibrc (should be installed somewhere in your
systeme) and changing the "backend" variable to Qt4Agg did the trick.



On Tue, Mar 27, 2012 at 12:14 AM, Magician  wrote:
> Hi.
>
> I want to install Matplotlib from source code on CentOS.
> I've been using Matplotlib for a year.
> But this is the first time for me to install CentOS by myself.
>
> I installed CentOS 6.2 in basic install option.
> Next, I installed NumPy and Matplotlib.
> .matplotlibrc isn't set.
>
> It looks successfully installed, but when I type show() command,
> nothing appears.
> I can export PNG image by using savefig() command, so maybe
> I'm using invalid backend.
>
> How can I display plots with show() command?
>
>
> Magician
>
> --
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Contributing

2012-03-22 Thread Alexis Praga
Hi,

After using Matplotlib for some time, I would like to give something
back to the community :)
How can I contribute ? I am aware that reporting and documentating the
project is always appreciated, but are there specific needs ? For
exemple, does a "TODO" list exist ?


Thanks

PS : Last time I asked for help, I forgot to thanks the people who
replied. So, Jeff and the others, you have my thanks :)

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plotting irregular data without interpolation

2012-02-01 Thread Alexis Praga
Hi,

I have not found any documentation on plotting non regular data with
basemap *without* interpolation.
Plotting scattered data on the sphere works fine, but the size of each
point seems to be limited, so there are "holes".
Is there an option in basemap for that ?


Alexis

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Suggestion for zooming (orthographic projection)

2012-01-19 Thread Alexis Praga
Hi,

Trying the code at
http://matplotlib.sourceforge.net/basemap/doc/html/users/ortho.html ,
for zooming in a certain region on a globe, I have found some issues
with the approach provided.
For example, it does not work on the poles.
Here is my suggestion for a zoom with a factor = coef.

#

from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
# global ortho map centered on lon_0,lat_0
lat_0=90.; lon_0=0.
# resolution = None means don't process the boundary datasets.
m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None)

width = m1.urcrnrx - m1.llcrnrx
height = m1.urcrnry - m1.llcrnry

coef = 0.5
width = width*coef
height = height*coef
m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution='l',\
   llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height)

m.drawcoastlines()
m.drawcountries()
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,360.,60.))
m.drawmapboundary()
plt.show()

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Remapping scattered data

2011-12-18 Thread Alexis Praga
Exactly. But I do not understand why some map projectionsautomatically
adjust the data and others don't.

Alexis
On Sun, Dec 18, 2011 at 3:53 PM, Jeff Whitaker  wrote:
> On 12/18/11 1:33 PM, Alexis Praga wrote:
>>
>> Hi,
>>
>> I may have found an issue with some map projections.When I try to plot
>> markers on a given map, and change the center ofprojection, the
>> markers' coordinates are not remapped correctly.If the marker's
>> coordinates are not inside the new boundaries, it issimply not
>> displayed in some cases.For example, remapping does work with Robin's
>> projection and does notwith Miller's.I have attached a small example.
>> Thanks !
>>
>>
>> Alexis Praga
>>
> Alexis: It looks like the coordinates you are plotting with scatter are
> between longitudes -180 and 180, and the map projection goes from 0 to 360.
>  Adjust your coordinates to lie within 0 and 360, and they will show up.
>
> This behavior will be map projection dependent - it will only show up in the
> cylindrical projections where the x coordinate is longitude.
>
> -Jeff
>
>

--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Remapping scattered data

2011-12-18 Thread Alexis Praga
Hi,

I may have found an issue with some map projections.When I try to plot
markers on a given map, and change the center ofprojection, the
markers' coordinates are not remapped correctly.If the marker's
coordinates are not inside the new boundaries, it issimply not
displayed in some cases.For example, remapping does work with Robin's
projection and does notwith Miller's.I have attached a small example.
Thanks !


Alexis Praga
import numpy as np
import sys 
import matplotlib.pyplot as p
from mpl_toolkits.basemap import Basemap

nb_lat = 2
nb_lon = 360
nb_lines = nb_lat*nb_lon
lat = np.zeros(nb_lines,float)
lon = np.zeros(nb_lines,float)
data = np.zeros(nb_lines,float)
k = 0
for i in range(nb_lat):
  for j in range(nb_lon):
lat[k] = i
lon[k] = j-180
data[k] = i+j
k = k + 1

## This works
#map = Basemap(projection='robin',lon_0=180,resolution='c')
# Not this
map = Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,llcrnrlon=0,urcrnrlon=360,resolution='c')
map.drawcoastlines()
map.drawmapboundary()

x,y = map(lon,lat)
map.scatter(x,y, s=10, c=data, marker='o',edgecolors='none')

p.savefig('dataset.jpg')
--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users