Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Christopher Barker
Simson Garfinkel wrote:
> I'm embarrassed to ask that I'm having trouble building/installing  
> matplotlib on an intel Mac.

Don't be embarassed -- it's really pretty hard!

All the various pythons (Universal, fink, darwinports, etc) for OS-X 
confuse things a lot, but I think you'll get the best support if you 
stick with the "official" framework Universal build:

http://www.python.org/download/

You can also get it from:

http://www.pythonmac.org/packages/py25-fat/index.html

The cool thing about that site is that you can get a bunch of pr-built 
compatible packages from there also.

Unfortunately, the matplotlib there right now doesn't appear to work 
with the latest wxPython. I'm not sure which wxPython version it is 
built against, but it crashed for me when used with wxPython2.8.3

The good news is, as I understand it, is the Ken McIvor patched the most 
recent MPL to use wxPython 2.8b features that allow you to build MPL 
without linking to wxPython.

Hopefully someone will do a build that works with wxPython2.8.3 and put 
it up on the pythonmac site soon. I may even do it, but I haven't needed 
to for a while, so I don't have it all set up at this point.

If you're going to built it yourself, still use the pythonmac packages 
for everything else, you'll be glad you did.

-Chris

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Building matplotlib on HP-UX with HP compilers

2007-04-04 Thread Bill Calver
Hi, I'm wondering if anyone has tried to build matplotlib on hpux with the hp 
compilers.  I'm running on 11i and python 2.4.3.  I've essentially built my own 
Makefile(s) with all of the hacks I've had to make to distutils but I am still 
not there.  Any help/suggestions are appreciated (aside from running on a 
different platform or using gcc ;-)-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Archana Ganesan

Hii,

I get the following error.
Traceback (most recent call last):
 File "trial.py", line 1, in ?
 File "pylab.pyo", line 1, in ?
 File "matplotlib\pylab.pyo", line 203, in ?
 File "matplotlib\axes.pyo", line 16, in ?
 File "matplotlib\axis.pyo", line 19, in ?
 File "matplotlib\patches.pyo", line 42, in ?
 File "matplotlib\patches.pyo", line 79, in Patch
 File "matplotlib\cbook.pyo", line 352, in dedent
AttributeError: 'NoneType' object has no attribute 'splitlines'

If I comment it out I am getting the error.

I have installed the following:

Python 2.4.4
http://www.python.org/download/releases/2.4.4/

wxPython runtime
win32-unicode for Python 2.4
http://www.wxpython.org/download.php

matplotlib-0.90.0.win32-py2.4.exe
http://sourceforge.net/project/showfiles.php?group_id=80706

numpy-1.0.1.win32-py2.4.exe
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103


setup.py is as follows.

from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
  shutil.rmtree("dist/prog")

if os.path.exists("dist/lib"):
  shutil.rmtree("dist/lib")

if os.path.exists("build"):
  shutil.rmtree("build")


#
#
# options for py2exe
options = {"py2exe": {"compressed": 1,
"optimize": 2,
"packages": ["encodings",
##   "kinterbasdb",
 "pytz",
 "matplotlib.numerix",

##   "email",
  ## "numpy"
##   "PIL",
 ],
   # "includes": "matplotlib.numerix.random_array",
"excludes": ["MySQLdb", "Tkconstants", "Tkinter",
"tcl",
 "orm.adapters.pgsql", "orm.adapters.mysql"
],
"dll_excludes": ["tcl84.dll", "tk84.dll",
"wxmsw26uh_vc.dll"]
}
}
zipfile = r"lib\library.zip"

setup(
classifiers = ["Copyright:: your name",
   "Development Status :: 5 Stable",
   "Intended Audience :: End User",
   "License :: Shareware",
   "Operating System :: Microsoft :: Windows 2000",
   "Operating System :: Microsoft :: Windows XP",
   "Operating System :: Microsoft :: Windows 9x",
   "Programming Language :: Python, wxPython",
   "Topic :: Home Use"
   "Natural Language :: German",
   "Natural Language :: French",
   "Natural Language :: English"],
  #  windows = [wx_emb],
console = ['trial.py'],
options = options,
zipfile = zipfile,
data_files = [("lib\\matplotlibdata", mpfiles),
   matplotlib.get_py2exe_datafiles() # if you don't use the
lib option
("prog\\amaradata", amaradata),
("prog\\amaradata\\Schemata", amaraschemata),
("prog\\", python4dll)
  ]
  )

trial.py is as follows.

from pylab import *

x = xrange(10)
plot(x)
savefig("trial.png")

Kindly help.

thank you.

Archana.

My trial.py is as follows

On 4/2/07, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:


Hi Archana,

Archana Ganesan wrote:
> Hi,
>
> I tried following the instructions at the py2exe site and I have also
> uncommeneted and made it include the matplotlib.numerix package. Still
> it doesnt seem to work. Is there any other way of compiling it into an
> executable?
Did you try to compile the sample I enclosed the other day?  Did that
work?  If not what error are you getting.

Are you using numpy or ?

Provide a small sample (with no dependencies if possible) which does not
work for you with the corresponding setup.py.

Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share you

Re: [Matplotlib-users] numpy migration

2007-04-04 Thread Alan G Isaac
On Wed, 4 Apr 2007, John Hunter apparently wrote: 
> If anyone has any comments or objections to this plan, speak now. 

Comment: great plan!

Cheers,
Alan Isaac





-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] numpy migration

2007-04-04 Thread Bill Baxter
On 4/5/07, John Hunter <[EMAIL PROTECTED]> wrote:
> in a recent thread on the matplotlib-devel list
>
>   http://thread.gmane.org/gmane.comp.python.matplotlib.devel/2646
>
> we've been discussing a plan to jettison support for the three array
> packages in matplotlib.

+1 from me.  I don't use the older packages at all.

--bb

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] numpy migration

2007-04-04 Thread John Hunter
in a recent thread on the matplotlib-devel list

  http://thread.gmane.org/gmane.comp.python.matplotlib.devel/2646

we've been discussing a plan to jettison support for the three array
packages in matplotlib.  There are a few good reasons for us to do
this

  * having multiple array based packages is bad for scientific
computing in python, and the numerix compatibility layer makes it
easier for us all to continue supporting all three and hinders
progress

  * there are a lot of nice features in numpy and numarray that we
cannot use internally in mpl development since we are relying on a
least common denominator compatibility layer

  * the matplotlib binaries are larger than they need to be, since we
have to compile our extension code against numpy, numarray and
numeric.  It also increase compile times significantly, which can be a
pain for developers.

Our basic plan is to do a release in the next couple of weeks which,
as before, utilizes the numerix layer internally but may issue
deprecation warnings for people using numerix with Numeric or
numarray.  After that, we will stop using numerix internally in
matplotlib development, though will retain the numerix layer
externally so your code which uses it will not break.  As long as you
are using a fairly recent version of Numeric or numarray which
supports the array interface, your code should continue to work with
matplotlib as far as I understand.  But internally, we'll be using
numpy (and you should too where possible).

So after the next release, matplotlib svn will begin to be converted
to numpy, which will probably take a while, and when it is done (say
in 6 weeks) we'll release the first numpy only mpl.

If anyone has any comments or objections to this plan, speak now.

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Reuse or clone axes / figure / ??? from basemap for time series plot

2007-04-04 Thread John Hunter
On 4/4/07, Simon Kammerer <[EMAIL PROTECTED]> wrote:
> Hi list,
>
> I guess it's not limited to the basemap toolkit, but it fits to explain
> my problem:
>
> I'd like to produce time series with basemap. As drawing coastlines,
> countrys etc. is expensive, but stays the same for every time step, I'd
> like to draw the basemap "background" only once and the reuse I.

This can probably be solved with the copy/blit/animate stuff described
at the end of
http://www.scipy.org/Cookbook/Matplotlib/Animations

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Robert Kern
Tim Hirzel wrote:
> Its a little tough right now that os x doesn't have one python 
> install to rule them all.

Yes it does.

  http://www.python.org/download/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Tim Hirzel
My understanding is that currently the best way to get all these 
packages (wxpython, matplotlib, numpy, etc) running together on os x is 
via these packages:
http://pythonmac.org/packages/

at least, I can say for sure that the 2.5 builds worked without a hitch 
for me.  Its a little tough right now that os x doesn't have one python 
install to rule them all.  Instead, there are about 5 (not an actual 
count) ways to do it, most with gotchas.
tim


Simson Garfinkel wrote:
> Alas, tried the easy_install matplotlib. It downloaded and installed  
> matplotlib, but didn't install wx, so I got this error:
>
>  >>> from pylab import *;
> Traceback (most recent call last):
>File "", line 1, in 
>File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
> pylab.py", line 1, in 
>  from matplotlib.pylab import *
>File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
> matplotlib/pylab.py", line 222, in 
>  new_figure_manager, draw_if_interactive, show = pylab_setup()
>File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
> matplotlib/backends/__init__.py", line 24, in pylab_setup
>  globals(),locals(),[backend_name])
>File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
> matplotlib/backends/backend_wxagg.py", line 19, in 
>  import wx
> ImportError: No module named wx
>  >>>
>
>
> When I tried to use easy_install to install wxPython, I got this:
>
> Computer:/Users/simsong root# easy_install wxPython
> Searching for wxPython
> Reading http://cheeseshop.python.org/pypi/wxPython/
> Reading http://wxPython.org/
> Reading http://wxPython.org/download.php
> Reading http://cheeseshop.python.org/pypi/wxPython/2.6.3.2
> Best match: wxPython src-2.8.3.0
> Downloading http://prdownloads.sourceforge.net/wxpython/wxPython- 
> src-2.8.3.0.tar.bz2
> Processing wxPython-src-2.8.3.0.tar.bz2
> error: Couldn't find a setup script in /tmp/easy_install-UB-WlK/ 
> wxPython-src-2.8.3.0.tar.bz2
> Computer:/Users/simsong root#
>
> Why do we make this so hard?
>
> The wyPython page for Mac says:
>
> 
>
> Mac OS X
>
> wxPython needs a special Mac OS X-specific build of Python, called a  
> Framework build, in order to work. Panther and Tiger include a  
> Framework build of Python 2.3, but on Jaguar you'll need to get the  
> MacPython installer from Jack's MacPython page.
> 
> (I really can't keep track of all these cat names. )
>
> Then I need to choose one of 8 different versions to install,  
> dependin gon whether I am using py2.3, 2.4 or 2.5, and whether I want  
> unicode or ansi, and whether I want PPC or Universal.
>
> But I finally got it installed. Thanks.
>
>
> On Apr 4, 2007, at 7:38 AM, Edin Salkovic wrote:
>
>   
>> On 4/4/07, Simson Garfinkel <[EMAIL PROTECTED]> wrote:
>> 
>>> 2. How do I install an EGG file?
>>>   
>> For detailed instructions about eggs see:
>> http://peak.telecommunity.com/DevCenter/EasyInstall
>>
>> Quick instructions:
>> Download:
>> http://peak.telecommunity.com/dist/ez_setup.py
>> and run it.
>>
>> then run
>> easy_install matplotlib
>> or
>> easy_install /path/to/matplotlib-xxx.egg
>>
>>
>> HTH,
>> Edin
>>
>> 
>
>
>
>
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>   

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Simson Garfinkel
Alas, tried the easy_install matplotlib. It downloaded and installed  
matplotlib, but didn't install wx, so I got this error:

 >>> from pylab import *;
Traceback (most recent call last):
   File "", line 1, in 
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
pylab.py", line 1, in 
 from matplotlib.pylab import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
matplotlib/pylab.py", line 222, in 
 new_figure_manager, draw_if_interactive, show = pylab_setup()
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
matplotlib/backends/__init__.py", line 24, in pylab_setup
 globals(),locals(),[backend_name])
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ 
matplotlib/backends/backend_wxagg.py", line 19, in 
 import wx
ImportError: No module named wx
 >>>


When I tried to use easy_install to install wxPython, I got this:

Computer:/Users/simsong root# easy_install wxPython
Searching for wxPython
Reading http://cheeseshop.python.org/pypi/wxPython/
Reading http://wxPython.org/
Reading http://wxPython.org/download.php
Reading http://cheeseshop.python.org/pypi/wxPython/2.6.3.2
Best match: wxPython src-2.8.3.0
Downloading http://prdownloads.sourceforge.net/wxpython/wxPython- 
src-2.8.3.0.tar.bz2
Processing wxPython-src-2.8.3.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-UB-WlK/ 
wxPython-src-2.8.3.0.tar.bz2
Computer:/Users/simsong root#

Why do we make this so hard?

The wyPython page for Mac says:



Mac OS X

wxPython needs a special Mac OS X-specific build of Python, called a  
Framework build, in order to work. Panther and Tiger include a  
Framework build of Python 2.3, but on Jaguar you'll need to get the  
MacPython installer from Jack's MacPython page.

(I really can't keep track of all these cat names. )

Then I need to choose one of 8 different versions to install,  
dependin gon whether I am using py2.3, 2.4 or 2.5, and whether I want  
unicode or ansi, and whether I want PPC or Universal.

But I finally got it installed. Thanks.


On Apr 4, 2007, at 7:38 AM, Edin Salkovic wrote:

> On 4/4/07, Simson Garfinkel <[EMAIL PROTECTED]> wrote:
>> 2. How do I install an EGG file?
>
> For detailed instructions about eggs see:
> http://peak.telecommunity.com/DevCenter/EasyInstall
>
> Quick instructions:
> Download:
> http://peak.telecommunity.com/dist/ez_setup.py
> and run it.
>
> then run
> easy_install matplotlib
> or
> easy_install /path/to/matplotlib-xxx.egg
>
>
> HTH,
> Edin
>




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Histogram align 'edge' or 'center' bug?

2007-04-04 Thread David Fokkema
On Wed, 2007-04-04 at 16:26 +0200, David Fokkema wrote:
> Hi group,
> 
> I have the following ipython 'session':
> 
> In [23]: data = [0, 0.4, 0.6, 1, 2, 3]
> 
> In [24]: bins = [0, 1, 2, 3]
> 
> In [25]: hist(data, bins, align='edge')
> Out[25]: (array([3, 1, 1, 1]), [0, 1, 2, 3],  objects>)
> 
> In [26]: hist(data, bins, align='center')
> Out[26]: (array([3, 1, 1, 1]), [0, 1, 2, 3],  objects>)
> 
> 
> I would suspect that the histogram output from 'center' should be [2, 2,
> 1, 1]. Why is this not so? At least, the two should be different? I
> would say that with edge, my bins would be 0-1, 1-2, 2-3, 3-4, and that
> center should give me -0.5-0.5, 0.5-1.5, 1.5-2.5, 2.5-3.5, but this
> seems not to be the case??? Any help understanding this would be greatly
> appreciated!

It seems that the hist function simply calls matplotlib.mlab.hist
without any regard to the bins (be they edge or centered values) and
passes the plotting through to the 'bar' function. This function places
the bar with either the edge at the bin value or the center at the bin
value. If I choose center, the result is that my histogram is calculated
for edge values but the bars are placed at center values which is
completely misleading and wrong! I'd say this is a bug, but I may be
overlooking something here...

Thanks,

David


> 
> Thanks,
> 
> David
> 
> 
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Histogram align 'edge' or 'center' bug?

2007-04-04 Thread David Fokkema
Hi group,

I have the following ipython 'session':

In [23]: data = [0, 0.4, 0.6, 1, 2, 3]

In [24]: bins = [0, 1, 2, 3]

In [25]: hist(data, bins, align='edge')
Out[25]: (array([3, 1, 1, 1]), [0, 1, 2, 3], )

In [26]: hist(data, bins, align='center')
Out[26]: (array([3, 1, 1, 1]), [0, 1, 2, 3], )


I would suspect that the histogram output from 'center' should be [2, 2,
1, 1]. Why is this not so? At least, the two should be different? I
would say that with edge, my bins would be 0-1, 1-2, 2-3, 3-4, and that
center should give me -0.5-0.5, 0.5-1.5, 1.5-2.5, 2.5-3.5, but this
seems not to be the case??? Any help understanding this would be greatly
appreciated!

Thanks,

David


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Edin Salkovic
On 4/4/07, Simson Garfinkel <[EMAIL PROTECTED]> wrote:
> 2. How do I install an EGG file?

For detailed instructions about eggs see:
http://peak.telecommunity.com/DevCenter/EasyInstall

Quick instructions:
Download:
http://peak.telecommunity.com/dist/ez_setup.py
and run it.

then run
easy_install matplotlib
or
easy_install /path/to/matplotlib-xxx.egg


HTH,
Edin

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Reuse or clone axes / figure / ??? from basemap for time series plot

2007-04-04 Thread Simon Kammerer
Hi list,

I guess it's not limited to the basemap toolkit, but it fits to explain 
my problem:

I'd like to produce time series with basemap. As drawing coastlines, 
countrys etc. is expensive, but stays the same for every time step, I'd 
like to draw the basemap "background" only once and the reuse I.

copy / deepcopy (module copy) the current axes doesn't work:
copy.Error: un(deep)copyable object of type 

Creating two identical axes with different label='XXX' doesn't work, 
because contourf will overwrite my background.
Same for adding a subplot to my figure.

Whats the way to "clone" an axes instance (or any other form of my 
background), so I can reuse it after I plotted the first time step and 
then called cla()?


Thanks
Simon




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problems building/installing

2007-04-04 Thread Simson Garfinkel
I'm embarrassed to ask that I'm having trouble building/installing  
matplotlib on an intel Mac.

The version at http://matplotlib.sourceforge.net/ wants to give me  
an .egg file for my Mac, and I have yet to figure out how to load and  
install .egg files. (How come python is such a mess?)

So I tried to install with darwinports. Darwinports proceeded to  
upgrade my python from 2.4 to 2.5 (thanks!) and then gave me an error  
installing numeric because the fortran compiler wouldn't build or  
something.

So I manually installed numeric (I don't need fortran support) and  
manually downloaded matplotlib to install with setup.py. But I'm  
getting this error:

building 'matplotlib.backends._tkagg' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g  
-bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ 
_tkagg.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/ 
temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3- 
fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/ 
CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/ 
usr/lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/ 
lib.macosx-10.3-fat-2.5/matplotlib/backends/_tkagg.so -framework Tcl - 
framework Tk
/usr/bin/ld: for/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
architecture i386
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccl92wxW.out (No such file or  
directory)
error: command 'g++' failed with exit status 1
Computer:/Users/simsong/Desktop/matplotlib-0.90.0 root#


This basically says that it can't build the universal version on my  
mac because I only have intel binaries for libpng, and not universal  
binaries.

I don't need universal binaries; I'm only running on intel.

I'd rather not go down this path, it turns out. It would be a lot  
easier for me just to download binaries.

What I would like to know is:

1. What is the preferred way for installing matplotlib on Mac at this  
point?
2. How do I install an EGG file?

Thanks!



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Best way to plot grid point values on a map?

2007-04-04 Thread Simon Kammerer
Thanks Jeff, that does what I want. It seems to be efficient, as long as 
you don't try to plot 10.000+ values on a small map (results in a 
colored rectangle anyway...). After thinning out my data

data = data.compress(maskX, axis=1)
data = data.compress(maskY, axis=0)

it seems to be only a little bit slower than contour / contourf.

Simon



Jeff Whitaker schrieb:
> Simon Kammerer wrote:
>> Hi list,
>>
>> what's the best (meaning most efficient/fastest) way to plot grid 
>> point values on a map created with basemap?
>>
>> I'd like to plot the raw values of my data-array to the correspondig 
>> gridpoints, instead of having it transformed to something like contour 
>> or contourf. The ne plus ultra would be the ability to assing a 
>> colormap, to control the font color of the plotted values...
>>
>> Regards
>> Simon
>>
>>   
> 
> Simon:  I don't know about efficiency, but this does what you want:
> 
> from pylab import show, title, arange, figure, title, arccos, pi, cm, 
> text, sqrt
> import random
> from matplotlib.colors import rgb2hex
> from matplotlib.toolkits.basemap import Basemap
> from matplotlib.numerix.random_array import uniform
> 
> # Plot a bunch of randomly distributed points on the earth.
> 
> # set up stereographic map centered on N. Pole.
> m = Basemap(lon_0=-105,boundinglat=30.,resolution='l',
>area_thresh=1.,projection='npstere')
> # number of points to plot.
> npts = 300
> # generate random points on a sphere,
> # so that every small area on the sphere is expected
> # to have the same number of points.
> # http://mathworld.wolfram.com/SpherePointPicking.html
> try: # this works for numpy
>u = uniform(0.,1.,size=npts)
>v = uniform(0.,1.,size=npts)
>z = uniform(0,100,size=npts)
> except: # this works for Numeric/numarray
>u = uniform(0.,1.,shape=npts)
>v = uniform(0.,1.,shape=npts)
>z = uniform(0,100,shape=npts)
> lons = 360.*u
> lats = (180./pi)*arccos(2*v-1) - 90.
> # transform lons and lats to map coordinates.
> x,y = m(lons,lats)
> # create a list of strings containing z values
> zn = [ '%2i' % zz for zz in z ]
> # plot numbers on map, colored by value.
> vmin = 0; vmax = 100
> cmap = cm.jet # use 'jet' colormap
> for name,zval,xpt,ypt in zip(zn,z,x,y):
># only plot values inside map region.
>if xpt > m.xmin and xpt < m.xmax and ypt > m.ymin and ypt < m.ymax:
>rgbcolor = cmap(1.-(zval-vmin)/(vmax-vmin))[:3]
>hexcolor = rgb2hex(rgbcolor)
>text(xpt,ypt,name,fontsize=9,weight='bold',color=hexcolor)
> # draw coasts and fill continents.
> m.drawcoastlines(linewidth=0.5)
> m.fillcontinents()
> # draw parallels and meridians.
> delat = 20.
> circles = arange(0.,90.,delat).tolist()+\
>  arange(-delat,-90,-delat).tolist()
> m.drawparallels(circles)
> delon = 45.
> meridians = arange(0,360,delon)
> m.drawmeridians(meridians,labels=[1,1,1,1])
> title('Random Data Value at Random Points',y=1.075)
> show()
> 
> 
> HTH,
> 
> -Jeff
> 
> 
> 
> 

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin

Hi Giorgio,

Had a quick look at pylab based scripts and got an error on 
backend_tkagg when py2exe it.  It looks like one needs to force the 
backend to be included, I used tkagg but you would have to replace that 
with wxagg for your script.


Attached is a setup.py and from the examples the file simple_plot.py.

Werner
# -*- coding: iso-8859-1 -*-#
from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
shutil.rmtree("dist/prog")

if os.path.exists("dist/lib"):
shutil.rmtree("dist/lib")

if os.path.exists("build"):
shutil.rmtree("build")



#
# A program using wxPython

# The manifest will be inserted as resource into the .exe.  This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
manifest_template = '''



%(prog)s





  

  


   
  

'''

RT_MANIFEST = 32
#

# options for py2exe
options = {"py2exe": {"compressed": 1,
  "optimize": 2,
  "packages": ["encodings",
   "pytz.zoneinfo.UTC", "matplotlib.numerix", 
"matplotlib.backends.backend_tkagg"
   ],
  "excludes": ["MySQLdb", ],
  "dll_excludes": ["wxmsw26uh_vc.dll"]
  }
  }
zipfile = r"lib\library.zip"

class MetaBase:
def __init__(self, **kw):
self.__dict__.update(kw)
self.version = '1.0'
self.author = "yourname"
self.author_email = "[EMAIL PROTECTED]"
self.company_name = ""
self.copyright = "2003 - 2007 by whoever"
self.url = "http://www.whatever.com/";
self.download_url = "http://www.whatever.com/en/";
self.trademark = ""
self.comments = "a comment on the prog"
self.name = "the prog name"
self.description = "a desc on the prog"

wx_emb = MetaBase(
script = "simple_plot.py",
other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="your prog name"))],
##icon_resources = [(1, r"images/some.ico")],
dest_base = r"prog\simple_plot")

setup(
  classifiers = ["Copyright:: your name",
 "Development Status :: 5 Stable",
 "Intended Audience :: End User",
 "License :: Shareware",
 "Operating System :: Microsoft :: Windows 2000",
 "Operating System :: Microsoft :: Windows XP",
 "Operating System :: Microsoft :: Windows 9x",
 "Programming Language :: Python, wxPython",
 "Topic :: Home Use"
 "Natural Language :: German",
 "Natural Language :: French",
 "Natural Language :: English"],
  windows = [wx_emb],
  options = options,
  zipfile = zipfile,
  data_files = [("lib\\matplotlibdata", mpfiles),
##matplotlib.get_py2exe_datafiles(), # if you don't use the 
lib option
]
)#!/usr/bin/env python
"""
Example: simple line plot.
Show how to make and save a simple line plot with labels, title and grid
"""
from pylab import *

t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)
plot(t, s)

xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)

#savefig('simple_plot.png')
savefig('simple_plot')

show()
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [SciPy-user] question about standalone small software and teaching

2007-04-04 Thread massimo sandal

Giorgio Luciano ha scritto:
At first I thought ... hey why people wat an interface, just use the 
console, and then after listening  to their reason I have to agree.
What do I generally do ? I have a matrix in txt, I apply my routines (a 
SVD, a PCA, a filter etc etc  written in python), plot them (using 
maplotlib) and then I want an output. that's it.
I started looking at various Qt etc. etc. but for me it's overhelming, 
because I think that the most important part should be dedicate to the 
routines creation and not to making a gui, compiling, etc. etc. I need 
simple command like people wants. grids, paste and copy, small working 
plots :)
I mean I can get crazy with setting my program, importing etc. etc. but 
I also have to say that needs and claim about writing simple guis, 
common paste and copy etc should be considered from someone there (we 
wait for the help of some guru that makes things easier ;)


It's quite hard for me to understand what you mean.

Anyway, I solved the issue of usability vs code simplicity for my data 
analysis application by using a mixed CLI+GUI design. That is, I have a 
very simple GUI that just shows the plot and may have some button/menu 
for basic operations, and a custom command line to finely work with it. 
Think of RasMol, for example. The custom command line is done with the 
Python Cmd module that is included with Python, and it's a breeze to 
code with. The GUI uses Matplotlib embedded with wxMPL in a wxPython 
frame. The command line and the GUI are threaded (work on two different 
threads) that communicate by passing events (cli-->gui) and with a Queue 
(gui-->cli): easy.


Anyway, I'd advice you to learn wxPython basics. It's powerful, free, 
multiplatform and it's becoming the default Python GUI toolkit in the 
wild. Learning a GUI toolkit cannot harm. If you can, buy the Robin Dunn 
book "wxPython in Action", it's wonderful to say the least.


m.
--
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
[EMAIL PROTECTED]

tel: +39-051-2094388
fax: +39-051-2094387
begin:vcard
fn:Massimo Sandal
n:Sandal;Massimo
org:University of Bologna;Department of Biochemistry
adr:;;Via Irnerio 48;Bologna;;40126;Italy
email;internet:[EMAIL PROTECTED]
tel;work:+39-051-2094388
tel;fax:+39-051-2094387
x-mozilla-html:FALSE
version:2.1
end:vcard

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin
Hi Giorgio,

Giorgio Luciano wrote:
> Hello Werner,
> and thank for the reply I've tried to recompile everything. The file 
> you sent in the mailing list give me the problem of wxmsw26uh_vc.dll 
> (and also dll missing while compiling)
For the wxmsw26uh_vc.dll you need to rename the .pyd file as mentioned 
in the response to Daniel before you py2exe it.

The error output you get when running py2exe is normal, it just tells 
you that there are files not included by py2exe.  You need to decide if 
you need them, if you have the right to distribute them etc and then 
either include them with your installer or add them to the package 
include option for py2exe.
> but then it runs
> when I try to compile my file (nipals) it doesnt' start and give me as 
> error
Sorry, I don't understand why you get the error about backends, but I 
can't run your nipals.py as it contains/uses modules I don't have.

I'll see if I can do a setup.py for a simple matplotlib file using pylab.

Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin
Hi Daniel,

Daniel Stalder wrote:
> Hello
>
> I saw your thread and I have a related problem.
> I use matplotlib (0.90.0.win32-py2.5) with wxPython
> (2.8-win32-unicode-2.8.3.0-py25).
> I use matplotlib with WXAgg and got the following error msg:
> "This application has failed to start because wxmsw26uh_vc.dll was not
> found. Re-installing the application may fix this problem."
>   
Re-install will not help.  The problem is that matplotlib is 
compiled/linked against wxPython 2.6 Unicode.

A work around Andrea Gavana found is to do the following rename, before 
you py2exe the app.

matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd


Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users