[Matplotlib-users] ImportError with basemap-0.99.3 windows binary installer

2009-02-04 Thread Scott Sinclair
Hi Jeff,

I'm seeing the following error with basemap-0.99.3 on Windows. It was
installed using the binary installer from sourceforge (as were Numpy
and Matplotlib).

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on

win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy

>>> numpy.__version__

'1.2.1'

>>> import matplotlib
>>> matplotlib.__version__
0.98.5.2
>>> from mpl_toolkits import basemap

Traceback (most recent call last):

  File "", line 1, in 

  File "C:\Python25\Lib\site-packages\mpl_toolkits\basemap\__init__.py", line 34

, in 

import pyproj, sys, os, math, dbflib

ImportError: No module named dbflib

>>>

>From a quick look at the setup.py in SVN (around line 170) it seems
that shapelib and dbflib might be installed on the machine where the
installer is built and "provide_pyshapelib  == 'auto'" is True during
the build process?

Cheers,
Scott

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError with basemap-0.99.3 windows binary installer

2009-02-04 Thread Jeff Whitaker
Scott Sinclair wrote:
> Hi Jeff,
>
> I'm seeing the following error with basemap-0.99.3 on Windows. It was
> installed using the binary installer from sourceforge (as were Numpy
> and Matplotlib).
>
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] 
> on
>
> win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
>   
 import numpy
 
>
>   
 numpy.__version__
 
>
> '1.2.1'
>
>   
 import matplotlib
 matplotlib.__version__
 
> 0.98.5.2
>   
 from mpl_toolkits import basemap
 
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
>   File "C:\Python25\Lib\site-packages\mpl_toolkits\basemap\__init__.py", line 
> 34
>
> , in 
>
> import pyproj, sys, os, math, dbflib
>
> ImportError: No module named dbflib
>
>   
>
> >From a quick look at the setup.py in SVN (around line 170) it seems
> that shapelib and dbflib might be installed on the machine where the
> installer is built and "provide_pyshapelib  == 'auto'" is True during
> the build process?
>
> Cheers,
> Scott
>
>   

Scott:  Yep, you are right.  I'll try to post a new installer today.

-Jeff

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] rc params strangeness/error

2009-02-04 Thread Leo Trottier
Matplotlib 0.98.5.2
Location: C:\leo\.matplotlib
Running Windows XP SP2
Obtained from pythonxy v. 2.1.10
No rc customizations ...

I've been having a devil of a time getting my rcParams to update
mid-script.  Perhaps this isn't possible, but if that's so, it's not
entirely clear.  Even if it is so, this is seemingly a defect, because in an
interactive session one expects quite different behavior (and no amount of
iPython %reset-ing seems to be able to help).

Note that manually setting the font (or what have you) in *title* works
fine.

Here is some example code:

## BEGIN #
import matplotlib
from matplotlib import rc, rcParams, rcdefaults
from matplotlib.pyplot import plot, show, figure, title

print matplotlib.__version__
print matplotlib.get_configdir()
print
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(4)
title('This should be in a sans-serif font')
show()

rcParams['font.sans-serif'] = rcParams['font.monospace']
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(1)
title('This should be in a monospace font')
show()

rcParams['font.sans-serif'] = rcParams['font.serif']
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(2)
title('This should be in a serif font')
show()

rcdefaults()
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(3)
title('This should be back to a sans-serif font')
show()
# END 
--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError with basemap-0.99.3 windows binary installer

2009-02-04 Thread Jeff Whitaker
Scott Sinclair wrote:
> Hi Jeff,
>
> I'm seeing the following error with basemap-0.99.3 on Windows. It was
> installed using the binary installer from sourceforge (as were Numpy
> and Matplotlib).
>
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] 
> on
>
> win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
>   
 import numpy
 
>
>   
 numpy.__version__
 
>
> '1.2.1'
>
>   
 import matplotlib
 matplotlib.__version__
 
> 0.98.5.2
>   
 from mpl_toolkits import basemap
 
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
>   File "C:\Python25\Lib\site-packages\mpl_toolkits\basemap\__init__.py", line 
> 34
>
> , in 
>
> import pyproj, sys, os, math, dbflib
>
> ImportError: No module named dbflib
>
>   
>
> >From a quick look at the setup.py in SVN (around line 170) it seems
> that shapelib and dbflib might be installed on the machine where the
> installer is built and "provide_pyshapelib  == 'auto'" is True during
> the build process?
>
> Cheers,
> Scott
>
>
>   
Scott:  I've replaced the windows installers on the sf download site - 
could you try the new ones and let me know if I've fixed the problem? 
Thanks.

-Jeff


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Christopher Brown
Hi,

CM> > I use:
CM> >
CM> > plt.gca().get_frame().set_linewidth(2)
CM> >
CM>
CM> That is not working for me.  Is it working now for the OP?

Actually, I just went back and found a reply from Jae-Joon to a post of 
mine in November about this. He points out that get_frame() is 
deprecated, but that gca().frame.set_linewidth(2) should work. This is 
not working for me either now (it was at the time), and now that I 
notice, I am also unable to change the tick width the way I used to:

for tl in pp.gca().get_xticklines() + pp.gca().get_yticklines():
 tl.set_markeredgewidth(2)

...and I also can get invert_yaxis() (or xaxis) to work either.

I'm on windows, using 0.98.5, ang Qt4Agg backend. I get no warnings or 
errors. Does anyone have any ideas?

-- 
Christopher Brown, Ph.D.
Department of Speech and Hearing Science
Arizona State University

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Michael Hearne
Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
any effect on the frame I created.

I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
telling me to use the patch object of the axes instead of get_frame().

So, when I use this with an axes created for a Basemap, I can't get the 
thickness of the frame around the axes to change.

I'm using Basemap 0.99.2.

The code demonstrating the issue is attached, and the relevant lines of 
code are near the bottom of the script.

Thanks,

Mike

Christopher Brown wrote:
> Hi Michael,
>
> MH> The Axes object has a method for turning on the frame:
> MH> set_frame_on().   How do I set the thickness of the frame that
> MH> appears?
>
> I use:
>
> plt.gca().get_frame().set_linewidth(2)
>


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Michael Hearne

Forgot the attachment...


Michael Hearne wrote:
Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
any effect on the frame I created.


I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
telling me to use the patch object of the axes instead of get_frame().


So, when I use this with an axes created for a Basemap, I can't get 
the thickness of the frame around the axes to change.


I'm using Basemap 0.99.2.

The code demonstrating the issue is attached, and the relevant lines 
of code are near the bottom of the script.


Thanks,

Mike

Christopher Brown wrote:

Hi Michael,

MH> The Axes object has a method for turning on the frame:
MH> set_frame_on().   How do I set the thickness of the frame that
MH> appears?

I use:

plt.gca().get_frame().set_linewidth(2)






#!/usr/bin/python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from pylab import *

fig = plt.figure()
ax1 = fig.add_axes([0,0,1.0,1.0])
bounds = (134,144,36,40)

clon = bounds[0] + (bounds[1]-bounds[0])/2.
clat = bounds[2] + (bounds[3]-bounds[2])/2.

# setup Lambert Conformal basemap.
m = Basemap(llcrnrlon=bounds[0],llcrnrlat=bounds[2],
urcrnrlon=bounds[1],urcrnrlat=bounds[3],
resolution='h',projection='merc',lat_ts=clat)

# draw coastlines.
m.drawcoastlines()
# draw a boundary around the map, fill the background.
# this background will end up being the ocean color, since
# the continents will be drawn on top.
m.drawmapboundary(fill_color='aqua') 
# fill continents, set lake color same as ocean color. 
m.fillcontinents(color='coral',lake_color='aqua')

left = 0.05
bottom = 0.05
width = 0.25
height = 0.25
llbounds = (left,bottom,width,height)

ax = fig.add_axes(llbounds)
map = Basemap(resolution='c',
  projection='ortho',
  lon_0=clon,lat_0=clat,ax=ax)

#print 'map created.'
map.drawcountries(linewidth=0.1,color=[0.2,0.2,0.2])
map.drawcoastlines(linewidth=0.05,color=[0.2,0.2,0.2])
map.drawlsmask((230,230,230,255),(119,155,207,255))
meridians = arange(-180,210,30)
parallels = arange(-90,120,30)
map.drawmeridians(meridians,linewidth=0.1,dashes=[1,0],color=[0.2,0.2,0.2])
map.drawparallels(parallels,linewidth=0.1,dashes=[1,0],color=[0.2,0.2,0.2])
pcx,pcy = map(clon,clat)

map.plot(array([pcx]),array([pcy]),'r*',linewidth=1,markersize=5,markeredgecolor='r')
map.drawmapboundary(color='k',linewidth=2.0)

ax.set_frame_on(True)
ax.patch.set_linewidth(4.0)

plt.savefig('output.png')


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Jeff Whitaker
Michael Hearne wrote:
> Forgot the attachment...

Michael: It's ax.frame.set_linewidth (not ax.patch).

-Jeff
>
>
> Michael Hearne wrote:
>> Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
>> any effect on the frame I created.
>>
>> I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
>> telling me to use the patch object of the axes instead of get_frame().
>>
>> So, when I use this with an axes created for a Basemap, I can't get 
>> the thickness of the frame around the axes to change.
>>
>> I'm using Basemap 0.99.2.
>>
>> The code demonstrating the issue is attached, and the relevant lines 
>> of code are near the bottom of the script.
>>
>> Thanks,
>>
>> Mike
>>
>> Christopher Brown wrote:
>>> Hi Michael,
>>>
>>> MH> The Axes object has a method for turning on the frame:
>>> MH> set_frame_on().   How do I set the thickness of the frame that
>>> MH> appears?
>>>
>>> I use:
>>>
>>> plt.gca().get_frame().set_linewidth(2)
>>>
>>
>>
>
> 
>
> --
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Jae-Joon Lee
> Actually, I just went back and found a reply from Jae-Joon to a post of
> mine in November about this. He points out that get_frame() is
> deprecated, but that gca().frame.set_linewidth(2) should work. This is
> not working for me either now (it was at the time), and now that I
> notice, I am also unable to change the tick width the way I used to:
>
> for tl in pp.gca().get_xticklines() + pp.gca().get_yticklines():
> tl.set_markeredgewidth(2)
>
> ...and I also can get invert_yaxis() (or xaxis) to work either.
>
> I'm on windows, using 0.98.5, ang Qt4Agg backend. I get no warnings or
> errors. Does anyone have any ideas?
>

Christopher,

Everything works fine for me.
Can it be just that the canvas is not redrawn after you set the linewidth?
It will be helpful if you post a standalone script that reproduces your problem.
Regards,

-JJ

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users