[Matplotlib-users] basemap-0.9.8 failure, linux

2007-12-28 Thread Evan Mason
Hi all,

Just updated basemap from 0.9.4 to 0.9.8 on Mandriva Linux 2008.  I also
installed basemap-data-fullres-0.9.7.  I've noticed there's a couple of
recent posts about problems (on Macs) with 0.9.8, the solution being to
install setuptools until 0.9.9 comes along; the problem I have is similar to
the posts but not the same, so I'd like to check here before proceeding with
setuptools.

I installed the included geos-2.2.3, then basemap-0.9.8, then
basemap-data-fullres-0.9.7.  However when I now import basemap I get:

In [1]: from matplotlib.toolkits.basemap import Basemap
---
   Traceback (most recent call last)

/home/emason/python/tools/ in ()

/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/__init__.py in
()
> 1 from basemap import __doc__, __version__
  2 from basemap import *

/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py in
()
 29 from matplotlib.cbook import is_scalar, dedent
 30 from shapelib import ShapeFile
---> 31 import _geos, pupynere
 32
 33 # basemap data files now installed in
lib/matplotlib/toolkits/basemap/data

: libgeos_c.so.1: cannot open shared object
file: No such file or directory

Yet the file, in fact a link, libgeos_c.so.1, does exist at the location
(/usr/local/lib) where it is supposed to be:

[EMAIL PROTECTED] lib]# ll
total 44230
-rw-r--r-- 1 root root 28107924 2007-12-28 16:31 libgeos.a
-rw-r--r-- 1 root root   581806 2007-12-28 16:31 libgeos_c.a
-rwxr-xr-x 1 root root  830 2007-12-28 16:31 libgeos_c.la*
lrwxrwxrwx 1 root root   18 2007-12-28 16:31 libgeos_c.so ->
libgeos_c.so.1.1.1*
lrwxrwxrwx 1 root root   18 2007-12-28 16:31 libgeos_c.so.1 ->
libgeos_c.so.1.1.1*
-rwxr-xr-x 1 root root   452162 2007-12-28 16:31 libgeos_c.so.1.1.1*
-rwxr-xr-x 1 root root  790 2007-12-28 16:31 libgeos.la*
lrwxrwxrwx 1 root root   16 2007-12-28 16:31 libgeos.so ->
libgeos.so.2.2.3*
lrwxrwxrwx 1 root root   16 2007-12-28 16:31 libgeos.so.2 ->
libgeos.so.2.2.3*
-rwxr-xr-x 1 root root 13443604 2007-12-28 16:31 libgeos.so.2.2.3*

I'd appreciate any help with this.

Thanks, Evan
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] power law fitting of data

2007-12-28 Thread Jessica Lu
Hi Johann,

I believe the scipy optimization package gives a variety of  
optimization algorithms but you would have to implement your own  
codes to fix/thaw parameters. That being said, there is a lot there  
and I haven't dug into all of it into detail. I would suggest posting  
a message to the scipy mailing list after the holidays and you may  
get a better response.

Cheers,
Jessica

On Dec 26, 2007, at 3:52 PM, Johann Cohen-Tanugi wrote:

> hi jessica, thanks So scipy.optmizer as it stands cannot do  
> that? I gues I should move the issue to the scipy list then. Yes  
> there is mpfit, there is also pyminuit in google.code that is  
> wrapper of the high energy physics standard package MINUIT, etc  
> but I would think that fitting data, with fixed/thawed parameters,  
> is a basic feature of a scientific package. As there seems to be a  
> snergy between matplotlib and scipy, I would expect the latter to  
> take care of optimization
> thanks for the replies,
> Johann
>
> Jessica Lu wrote:
>> Hi Johann,
>>
>> I would recommend using the python mpfit module:
>>
>> http://cars9.uchicago.edu/software/python/mpfit.html
>>
>> Cheers,
>> Jessica
>>
>> On Dec 22, 2007, at 8:57 PM, Johann Cohen-Tanugi wrote:
>>
>>> hi jessica,
>>> This FittingData tutorial is very nice. Could you illustrate how to
>>> fix/thaw parameters?
>>> I did not find any such attribute and when I try some kludges  
>>> they fail
>>> with a msg saying
>>> : shape mismatch: objects cannot be
>>> broadcast to a single shape
>>>
>>>
>>> thanks,
>>> Johann
>>>
>>>  
>>> -
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>>> 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
>>>
>>
>


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] basemap-0.9.8 failure, linux

2007-12-28 Thread Jeff Whitaker
Evan Mason wrote:
> Hi all,
>
> Just updated basemap from 0.9.4 to 0.9.8 on Mandriva Linux 2008.  I 
> also installed basemap-data-fullres-0.9.7.  I've noticed there's a 
> couple of recent posts about problems (on Macs) with 0.9.8, the 
> solution being to install setuptools until 0.9.9 comes along; the 
> problem I have is similar to the posts but not the same, so I'd like 
> to check here before proceeding with setuptools.
>
> I installed the included geos-2.2.3, then basemap-0.9.8, then 
> basemap-data-fullres-0.9.7 .  However when I now import basemap I get:
>
> In [1]: from matplotlib.toolkits.basemap import Basemap
> ---
>Traceback (most recent call 
> last)
>
> /home/emason/python/tools/ in ()
>
> /usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/__init__.py 
> in ()
> > 1 from basemap import __doc__, __version__
>   2 from basemap import *
>
> /usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py 
> in ()
>  29 from matplotlib.cbook import is_scalar, dedent
>  30 from shapelib import ShapeFile
> ---> 31 import _geos, pupynere
>  32
>  33 # basemap data files now installed in 
> lib/matplotlib/toolkits/basemap/data
>
> : libgeos_c.so.1: cannot open shared 
> object file: No such file or directory
>
> Yet the file, in fact a link, libgeos_c.so.1, does exist at the 
> location (/usr/local/lib) where it is supposed to be:
>
> [EMAIL PROTECTED] lib]# ll
> total 44230
> -rw-r--r-- 1 root root 28107924 2007-12-28 16:31 libgeos.a
> -rw-r--r-- 1 root root   581806 2007-12-28 16:31 libgeos_c.a
> -rwxr-xr-x 1 root root  830 2007-12-28 16:31 libgeos_c.la*
> lrwxrwxrwx 1 root root   18 2007-12-28 16:31 libgeos_c.so -> 
> libgeos_c.so.1.1.1*
> lrwxrwxrwx 1 root root   18 2007-12-28 16:31 libgeos_c.so.1 -> 
> libgeos_c.so.1.1.1*
> -rwxr-xr-x 1 root root   452162 2007-12-28 16:31 libgeos_c.so.1.1.1*
> -rwxr-xr-x 1 root root  790 2007-12-28 16:31 libgeos.la*
> lrwxrwxrwx 1 root root   16 2007-12-28 16:31 libgeos.so -> 
> libgeos.so.2.2.3*
> lrwxrwxrwx 1 root root   16 2007-12-28 16:31 libgeos.so.2 -> 
> libgeos.so.2.2.3*
> -rwxr-xr-x 1 root root 13443604 2007-12-28 16:31 libgeos.so.2.2.3*
>
> I'd appreciate any help with this.
>
> Thanks, Evan

Evan:  I think this is a LD_LIBRARY_PATH problem.  There are two 
possible workarounds:

1) set the LD_LIBRARY_PATH environment variable to include 
/usr/local/lib, i.e.

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

2) edit setup.py and make the following change

currents_nbp:(basemap_svn)$ svn diff
Index: setup.py
===
--- setup.py(revision 4791)
+++ setup.py(working copy)
@@ -90,7 +90,11 @@

extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs
 
= ['src'],))
 # for some reason, pickling won't work if this extension is installed
 # as "matplotlib.toolkits.basemap._geos"
-extensions.append(Extension("_geos",['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,libraries=['geos_c','geos']))
 

+extensions.append(Extension("_geos",['src/_geos.c'],
+library_dirs=geos_library_dirs,
+runtime_library_dirs=geos_library_dirs,
+include_dirs=geos_include_dirs,
+libraries=['geos_c','geos']))

then rebuild.  As Eric Firing pointed out to me, adding 
runtime_library_dirs negates the need to set LD_LIBRARY_PATH manually.  
This is already done in svn, and so 0.9.9 will not require manually 
setting LD_LIBRARY_PATH.

HTH,

-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 2005.
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] basemap-0.9.8 failure, linux

2007-12-28 Thread Evan Mason
Thank you Jeff.  Setting LD_LIBRARY_PATH works fine as a quick test, though
that leads me to the "ImportError: No module named pkg_resources" problem
that the other recent posters had.  I'll either try setuptools or wait for
0.9.9 to come out - will it be long?

-Evan
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] basemap-0.9.8 failure, linux

2007-12-28 Thread Jeff Whitaker
Evan Mason wrote:
> Thank you Jeff.  Setting LD_LIBRARY_PATH works fine as a quick test, 
> though that leads me to the "ImportError: No module named 
> pkg_resources" problem that the other recent posters had.  I'll either 
> try setuptools or wait for 0.9.9 to come out - will it be long?
>
> -Evan

Evan:  Sometime next week probably,  If you have svn installed, you can 
get the latest version that way.

-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 2005.
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] Problems adding arrow to plot

2007-12-28 Thread Fernando Abilleira
Dear matplotlib colleagues,

I am very new to matplotlib but I have been able to generate the plots I need; 
however, I am having trouble annotating a plot with an arrow. Could you help me 
with the syntax? Here is the code I am using:

ax.annotate('sol 
9',xy=(xMinorLocs[9],0.5),xytext=(xMinorLocs[9],0.8),arrowprops=dict(width=1, 
frac=0.1, headwidth=5, facecolor='black'))  

when I do that, I get a 'ZeroDivisionError: float division'

As a test, I tried the command without the arrowprops:
ax.annotate('sol 9',xy=(xMinorLocs[9],0.5),xytext=(xMinorLocs[9],0.8))

and I didn't get any errors and the label was plotted (no arrow) at the right 
location. How can I get the arrow to show up?

Any help you can provide would be really appreciated.

Thanks and happy Holidays!

Fernando


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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