Christopher Barker | 1 Apr 01:19
Picon
Favicon

What's up with py2exe_datafiles?

Hi all,

as far as I can tell, matplotlib.py2exe_datafiles is broken with the 
latest release. Is it getting fixed?

Also, there is a LOT of stuff in there -- is there a way to strip out 
the stuff you may not need for a particular application? I'm using MPl 
embedded in a wxPython app, and I don't need the icons, etc, nor do a 
need a bunch of fonts. I suppose it's just disk space, though.

One more question:

In mpl-data, there are a bunch of images and fonts. There are also 
subdirectories "images", and "fonts", with a bunch more? My the 
different places for these?

-CHB

--

-- 
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

Chris.Barker@...

-------------------------------------------------------------------------
(Continue reading)

Michael Droettboom | 1 Apr 14:09

Re: What's up with py2exe_datafiles?

Christopher Barker wrote:
> Hi all,
>
> as far as I can tell, matplotlib.py2exe_datafiles is broken with the 
> latest release. Is it getting fixed?
>
> Also, there is a LOT of stuff in there -- is there a way to strip out 
> the stuff you may not need for a particular application? I'm using MPl 
> embedded in a wxPython app, and I don't need the icons, etc, nor do a 
> need a bunch of fonts. I suppose it's just disk space, though.
>
> One more question:
>
> In mpl-data, there are a bunch of images and fonts. There are also 
> subdirectories "images", and "fonts", with a bunch more? My the 
> different places for these?
>   
I can't speak for py2exe specifically, but the source tree doesn't have 
any fonts or images at the root of mpl-data.  Perhaps the py2exe script 
is copying things there?

Mike

--

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

(Continue reading)

Michael Droettboom | 1 Apr 14:06

Re: Radial Plot Weirdness

Nick Susch wrote:
> Hi,
>
> I am new to this list, so forgive me if this has been asked before. I 
> am trying to do a radial plot and the following code does not seem to 
> work:
>
> # ------< START CODE >-------
> import pylab
> import matplotlib
>
> fig = pylab.figure(figsize=(8,8))
> ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
>
> pylab.hold(True)
> ax.plot([4.189, 4.188],[41.347, 41.058], color = 'green', lw=1)
> #ax.plot([4.199, 4.188],[41.347, 41.058], color = 'green', lw=1)
> ax.set_rmax(80) # scale plot
> pylab.show()
> # ------< END CODE >-------
>
>
> When you run this, the entire background of the plot turns green. If 
> you comment out the first "ax.plot" and uncomment the line below it, 
> it works as expected. Any ideas as to what is going on? Is there some 
> kind of limitation to the smallest line allowed? Thanks for any help!
It may be that the line is too close to unity and Agg (the rendering 
engine) is messing up.  That's the best explanation I can think of as 
well...

(Continue reading)

Robert Kern | 1 Apr 20:20
Picon
Gravatar

Re: scipy, matplotlib import errors

John wrote:
> Hello, could someone please help me understand a strange problem, 
> possibly associated with PYTHONPATH. When I import matplotlib, pylab, or 
> scipy from any directory other than the root installation directory, it 
> fails. However, if I'm in the python installation directory there are no 
> errors. Thanks in advance! Please see below:
> 
> *[jfb <at> andLinux ~]$ python*
> Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import scipy
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in 
> <module>
>     import pkg_resources as _pr # activate namespace packages 
> (manipulates __path__)
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, 
> in <module>
>     add_activation_listener(lambda dist: dist.activate())
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in 
> subscribe
>     callback(dist)
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, 
> in <lambda>
>     add_activation_listener(lambda dist: dist.activate())
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, 
> in activate
>     map(declare_namespace, self._get_metadata('namespace_packages.txt'))
(Continue reading)

KURT PETERS | 1 Apr 23:06
Picon
Favicon
Gravatar

gca.annotate doesn't work scatter does

can someone explain why scatter would work but gca.annotate would not when 
plotting data on a map (see previous posts)?
  I've also tried pylib.figtext and that doesn't work either.

Regards,
Kurt

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Jeff Whitaker | 1 Apr 23:22
Favicon

Re: gca.annotate doesn't work scatter does

KURT PETERS wrote:
> can someone explain why scatter would work but gca.annotate would not when 
> plotting data on a map (see previous posts)?
>   I've also tried pylib.figtext and that doesn't work either.
>
> Regards,
> Kurt
>
>
>   

Kurt:  This works for me (with the latest svn version of basemap and 
matplotlib).  Does it not work for you?

import pylab as p
from mpl_toolkits.basemap import Basemap as Basemap # use for svn
#from matplotlib.toolkits.basemap import Basemap # use for released version
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
             projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
shp_info = m.readshapefile('citiesx020','cities')
for xy in m.cities:
    p.gca().annotate('x',xy)
m.drawcoastlines()
p.show()

-Jeff

--

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
(Continue reading)

KURT PETERS | 1 Apr 23:31
Picon
Favicon
Gravatar

Re: Basemaps - shapefile import/display for points

Jeff,
  Do you think it's possible the names or CITIESX020 variable are not being 
brought in in the right order?
  I modified my code to use scatter, and, although it looks like the dots 
are in the right place, the names aren't matching?
see code:
=========
import pylab as p
import numpy
from matplotlib.toolkits.basemap import Basemap as Basemap
from matplotlib.colors import rgb2hex
from matplotlib.patches import Polygon

# Lambert Conformal map of lower 48 states.
# create new figure
#http://nationalatlas.gov/metadata/citiesx020.faq.html
#http://nationalatlas.gov/atlasftp.html?openChapters=chpref#chpref
fig=p.figure()
m1 = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
            projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
shp_info = 
m1.readshapefile(r'C:\Python25\Lib\basemap-0.9.9.1\examples\citiesx020','states',drawbounds=True)

ax=p.gca()

#define SHPT_POINT        1    Points
#define SHPT_ARC          3    Arcs (Polylines, possible in parts)
#define SHPT_POLYGON      5    Polygons (possible in parts)
#define SHPT_MULTIPOINT   8    MultiPoint (related points)
print shp_info
(Continue reading)

Jeff Whitaker | 1 Apr 23:54
Favicon

Re: Basemaps - shapefile import/display for points

KURT PETERS wrote:
> Jeff,
>  Do you think it's possible the names or CITIESX020 variable are not 
> being brought in in the right order?
>  I modified my code to use scatter, and, although it looks like the 
> dots are in the right place, the names aren't matching?
> see code:
> =========
> import pylab as p
> import numpy
> from matplotlib.toolkits.basemap import Basemap as Basemap
> from matplotlib.colors import rgb2hex
> from matplotlib.patches import Polygon
>
> # Lambert Conformal map of lower 48 states.
> # create new figure
> #http://nationalatlas.gov/metadata/citiesx020.faq.html
> #http://nationalatlas.gov/atlasftp.html?openChapters=chpref#chpref
> fig=p.figure()
> m1 = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
>            projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
> shp_info = 
>
m1.readshapefile(r'C:\Python25\Lib\basemap-0.9.9.1\examples\citiesx020','states',drawbounds=True) 
>
>
> ax=p.gca()
>
> #define SHPT_POINT        1    Points
> #define SHPT_ARC          3    Arcs (Polylines, possible in parts)
(Continue reading)

carlwenrich | 2 Apr 00:17
Picon
Favicon

How do I make the ticks go from 0 to 100?


I have a dataset where the values range from 20 to 90, but I want the y
coordinates to go from 0 to 100.
Also, how can I draw a highlight (colored line) across the chart at 30, and
another at 70?
--

-- 
View this message in context: http://www.nabble.com/How-do-I-make-the-ticks-go-from-0-to-100--tp16427710p16427710.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Jeff Whitaker | 2 Apr 01:06
Favicon

Re: How do I make the ticks go from 0 to 100?

carlwenrich wrote:
> I have a dataset where the values range from 20 to 90, but I want the y
> coordinates to go from 0 to 100.
>   
import pylab

pylab.ylim(0,100)
> Also, how can I draw a highlight (colored line) across the chart at 30, and
> another at 70?
>   

pylab.axhline(30,color='r')
pylab.axhline(70.color='r')

HTH,

-Jeff

--

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@...
325 Broadway                Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
(Continue reading)


Gmane