Re: [Matplotlib-users] build matplotlib including backend wxPython

2008-01-23 Thread Matthias Michler
Hello Ken,
Hello Mike,
Hello all,

On Tuesday 22 January 2008 19:33, Ken McIvor wrote:
> On Jan 22, 2008, at 11:00 AM, Matthias Michler wrote:
> > I was not up to date with my installation and I tried to use the
> > latest svn
> > version (trunk) on my Debian etch. I have a problem to build
> > matplotlib
> > including support for wxPython as backend. The output is attached
> > below.
> >
> > Actually I cannot find a file "wxPython.h" on my system.
>
> The wxPython Debian packages do not include the development headers
> required to build the WXAgg accelerator module.  The WXAgg backend
> will work just fine without it, so you should disable the module by
> editing setup.cfg and uncommenting the line "wxagg = False" in the
> "gui_support" section.
>
> Please let me know if you haven't created a setup.cfg file and are
> receiving this error straight "out of the box", as that's indicative
> of a bug in the build system.  Thanks!

First of all thanks a lot for your (Mike and Ken) suggestions. I will try it 
later that day.
I'm quite sure I did not create a setup.cfg file before this error message 
occured the first time. I deleted my setup.cfg and the error message seems 
quite similar (it is attached).

thanks again for your help, best regards 
Matthias
$ python setup.py build

BUILDING MATPLOTLIB
matplotlib: 0.98pre
python: 2.4.4 (#2, Apr  5 2007, 20:11:18)  [GCC 4.1.2
20061115 (prerelease) (Debian 4.1.1-21)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.0.4
 freetype2: 9.10.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.15beta5
   Tkinter: Tkinter: 39220, Tk: 8.4, Tcl: 8.4
  wxPython: 2.6.3.2
* Could not find wxPython headers in any of
* '/usr/lib/wx/include/gtk2-unicode-release-2.6',
* '/usr/include/wx-2.6'
  Gtk+: gtk+: 2.8.20, glib: 2.12.4, pygtk: 2.8.6, pygobject:
[pre-pygobject]
Qt: Qt: 3.3.6, PyQt: 3.16
   Qt4: no
 Cairo: 1.2.0

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: present, version unknown
  pytz: 2006p

OPTIONAL USETEX DEPENDENCIES
dvipng: 1.9
   ghostscript: 8.15.3
 latex: 3.141592
   pdftops: 3.01

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: matplotlib will provide
  enthought.traits: matplotlib will provide

[Edit setup.cfg to suppress the above messages]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> 
build/lib.linux-i686-2.4/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> 
build/lib.linux-i686-2.4/matplotlib/mpl-data
running build_ext
building 'matplotlib.backends._wxagg' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall 
-Wstrict-prototypes -fPIC

compile options: '-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 
-D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -I/usr/include/libpng12 
-I/usr/local/include -I/usr/include -I. 
-I/var/lib/python-support/python2.4/numpy/core/include -Isrc -Iagg24/include 
-I. -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. 
-I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6 
-I/usr/include/python2.4 -c'
gcc: src/_wxagg.cpp
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
In file included from /usr/include/python2.4/Python.h:8,
 from ./CXX/WrapPython.h:47,
 from ./CXX/Extensions.hxx:48,
 from src/_backend_agg.h:8,
 from src/_wxagg.cpp:48:
/usr/include/python2.4/pyconfig.h:851:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
 from 
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstring:52,
 from src/_wxagg.cpp:38:
/usr/include/features.h:150:1: warning: this is the location of the previous 
definition
src/_wxagg.cpp:55:34: error: wx/wxPython/wxPython.h: No such file or directory
src/_wxagg.cpp: In member function 'Py::Object 
_wxagg_module::convert_agg_to_wx_image(const Py::Tuple&)':
src/_wxagg.cpp:103: error: 'wxPyConstructObject' was not declared in this scope
src/_wxagg.cpp: In member function 'Py::Object 
_wxagg_module::convert_agg_to_wx_bitmap(const Py::Tuple&)':
src/_wxagg.cpp:125: error: 'wxPyConstructObject' was not declared in this scope
src/_wxagg.cpp: In function 'void init_wxagg()':
src/_wxagg.cpp:253: error: 'wxPyCoreAPI_IMPORT' was not declared in this scope
/var/lib/python-support/python2.4/numpy/core/include/numpy/_

Re: [Matplotlib-users] Problem with cygwin/ipython interactive mode

2008-01-23 Thread Pete Forman
[EMAIL PROTECTED] writes:

 > On a more general note it seems there are dozens of different ways
 > to run matplotlib under windows.

TkAgg gave me the same set of problems as you on Windows (native).
I was able to use WxAgg instead.  wxPython 2.8 did not work but
switching to 2.6 cured that.  IIRC others hacked some binaries to get
2.8 going.
-- 
Pete Forman-./\.-  Disclaimer: This post is originated
WesternGeco  -./\.-   by myself and does not represent
[EMAIL PROTECTED]-./\.-   the opinion of Schlumberger or
http://petef.port5.com   -./\.-   WesternGeco.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] build matplotlib including backend wxPython

2008-01-23 Thread Christopher Barker
Just another note:

If you can use wxPython 2.8.*, then this problem should go away. 2.8 
added some methods that allow more directly moving bitmaps from Agg to 
wxPython, eliminating the need for any extension code.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with cygwin/ipython interactive mode

2008-01-23 Thread John Hunter
On Jan 22, 2008 11:11 PM,  <[EMAIL PROTECTED]> wrote:

> I checked the instructions on :
> http://matplotlib.sourceforge.net/interactive.html
> and have used the config file there with minor changes for TkAgg and
> interactive mode.  However this also did not work.  Note : again under
> cygwin I placed the file in ~/.matplotlib/matplotlibrc rather than the
> suggested windows location and this seemed to work.
>
> While interactive mode is useful it is not mandatory for what I am doing
> and perhaps the easiest thing to do is set matplotlib to dump all output
> to files...

I have never used mpl under cygwin in windows, but it might help to
make sure your parameters and config files are as you expect.  For
example, in interactive mode, you should not need to call show to get
the figure to appear.  Please report the output of a test script in
the same environment with the --verbose-helpful flag

> python test.py --verbose-helpful

where test.py is something like:

  from pylab import plot, show
  plot([1,2,3])
  show()

this should echo your backedn and interactive settings, as well as the
matplotlibrc file location.

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib.toolkits.basemap. Basemap overlays?

2008-01-23 Thread Jim Vickroy
Hello users,

I'm using matplotlib.toolkits.basemap.Basemap to plot data on several 
types of projections at a regular cadence.  I am presently regenerating 
the maps each time new data is to be plotted.  Is it possible to 
generate template map projections once (at startup) and reuse them each 
time new data is to be plotted?  If so, could someone point to a 
reference or example of how to do this?

Thanks,
-- jv

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.toolkits.basemap. Basemap overlays?

2008-01-23 Thread Jeff Whitaker
Jim Vickroy wrote:
> Hello users,
>
> I'm using matplotlib.toolkits.basemap.Basemap to plot data on several 
> types of projections at a regular cadence.  I am presently regenerating 
> the maps each time new data is to be plotted.  Is it possible to 
> generate template map projections once (at startup) and reuse them each 
> time new data is to be plotted?  If so, could someone point to a 
> reference or example of how to do this?
>
> Thanks,
> -- jv
>   

Jim:  You can reuse a Basemap instance to plot data on multiple figures, 
like this

# create the first figure
fig = pylab.figure()
# create a Basemap instance for your map projection
map = Basemap(...)
# plot some stuff on this map projection.
map.contour(...)
 ... some other plotting commands ...
# save the figure
pylab.savefig('plot1.png')

# create another figure
fig = pylab.figure()
# use the same basemap instance to different data on this map projection
map.contour(...)
... more plotting commands...
# save the second figure
pylab.savefig('plot2.png')

You can also save the Basemap instance to disk using the Pickle module 
and reload it in another script.

-Jeff


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : [EMAIL PROTECTED]
325 BroadwayOffice : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.toolkits.basemap. Basemap overlays?

2008-01-23 Thread Pierre GM
On Wednesday 23 January 2008 14:57:26 Jim Vickroy wrote:
> Hello users,
>
> I'm using matplotlib.toolkits.basemap.Basemap to plot data on several
> types of projections at a regular cadence.  I am presently regenerating
> the maps each time new data is to be plotted.  Is it possible to
> generate template map projections once (at startup) and reuse them each
> time new data is to be plotted?  If so, could someone point to a
> reference or example of how to do this?

You could try to pickle the basemap instance, that should save you some 
initialization time. Then, it's just a matter of replotting.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.toolkits.basemap. Basemap overlays?

2008-01-23 Thread Jim Vickroy
Jeff Whitaker wrote:
> Jim Vickroy wrote:
>> Hello users,
>>
>> I'm using matplotlib.toolkits.basemap.Basemap to plot data on several 
>> types of projections at a regular cadence.  I am presently 
>> regenerating the maps each time new data is to be plotted.  Is it 
>> possible to generate template map projections once (at startup) and 
>> reuse them each time new data is to be plotted?  If so, could someone 
>> point to a reference or example of how to do this?
>>
>> Thanks,
>> -- jv
>>   
>
> Jim:  You can reuse a Basemap instance to plot data on multiple 
> figures, like this
>
> # create the first figure
> fig = pylab.figure()
> # create a Basemap instance for your map projection
> map = Basemap(...)
> # plot some stuff on this map projection.
> map.contour(...)
> ... some other plotting commands ...
> # save the figure
> pylab.savefig('plot1.png')
>
> # create another figure
> fig = pylab.figure()
> # use the same basemap instance to different data on this map projection
> map.contour(...)
> ... more plotting commands...
> # save the second figure
> pylab.savefig('plot2.png')
>
> You can also save the Basemap instance to disk using the Pickle module 
> and reload it in another script.
>
> -Jeff
>
>
Thanks for the detailed explanation; I may be starting to understand the 
significance of *figure*.

I was hoping to avoid repeated calls like map.drawcoastlines(), 
map.drawcountries(), map.fillcontinents(color='0.95'), 
map.drawmapboundary(), map.drawmeridians(plot.arange(0,360,30)), and 
map.drawparallels(plot.arange(-90,90,30)).  So, I will follow your 
example and experiment to see what works and what does not to better 
understand the behaviors.

-- jv


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot order

2008-01-23 Thread Jordan Dawe
Ok, I've spent a while searching through the mailing list archives and I 
can't find an answer for this relatively simple problem.  I've plotted a 
series of contourf and contour plots on the same axes.

First I plot a contourf.
Next a contour on top of it.
Then I want a contourf plotted on top of both the previous contourf and 
contour plots.
And finally, a contour on top of the second contourf.

However, when I do this the result is the two contour plots are drawn on 
top of the contourf plots no matter what.  How do I hide the contours 
under a contourf?

Jordan

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot order

2008-01-23 Thread Rob Hetland

On Jan 24, 2008, at 8:11 AM, Jordan Dawe wrote:
> However, when I do this the result is the two contour plots are  
> drawn on
> top of the contourf plots no matter what.  How do I hide the contours
> under a contourf?

zorder.

It won't really matter what order you plot, as long as you set the  
zorder of the objects to the order you want.  However, there is no  
set_zorder for the whole contour, rather just for each element in the  
collection.  Observe:

pc = contour(random.rand(10,10))
pcf = contourf(random.rand(10,10), cmap=cm.gray)
# now the contours are on top

for l in pc.collections:
 l.set_zorder(-100)

draw()
# now the contours are on the bottom



I guess the advantage is that you could pick and choose which  
contours to expose:

for l in pcf.collections[::2]:
 l.set_zorder(-1000)

draw()
# woven contours and contourfs...


-Rob


Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users