SF.net SVN: matplotlib: [4556] trunk/py4science/workbook

2007-12-03 Thread fer_perez
Revision: 4556
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4556&view=rev
Author:   fer_perez
Date: 2007-12-03 00:22:16 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Reorganize a bit.  Waste 2 hours dealing with utf-8 problems with latex...

Modified Paths:
--
trunk/py4science/workbook/intro_to_python.tex
trunk/py4science/workbook/ipython_tut.tex
trunk/py4science/workbook/main.tex
trunk/py4science/workbook/matplotlib_tut.tex
trunk/py4science/workbook/qsort.tex
trunk/py4science/workbook/why_python.tex
trunk/py4science/workbook/wrapping.tex

Added Paths:
---
trunk/py4science/workbook/introduction.tex

Modified: trunk/py4science/workbook/intro_to_python.tex
===
--- trunk/py4science/workbook/intro_to_python.tex   2007-12-03 04:56:57 UTC 
(rev 4555)
+++ trunk/py4science/workbook/intro_to_python.tex   2007-12-03 08:22:16 UTC 
(rev 4556)
@@ -734,13 +734,12 @@
 
 
 \end{lyxcode}
-There are two string methods, \texttt{split} and \texttt{join}, that
-arise frequenctly in Numeric processing, specifically in the context
-of processing data files that have comma, tab, or space separated
-numbers in them. \texttt{split} takes a single string, and splits
-it on the indicated character to a sequence of strings. This is useful
-to take a single line of space or comma separated values and split
-them into individual numbers
+There are two string methods, \texttt{split} and \texttt{join}, that arise
+frequenctly in numerical processing, specifically in the context of processing
+data files that have comma, tab, or space separated numbers in
+them. \texttt{split} takes a single string, and splits it on the indicated
+character to a sequence of strings. This is useful to take a single line of
+space or comma separated values and split them into individual numbers
 
 \begin{lyxcode}
 
\textcolor{blue}{\#~s~is~a~single~string~and~we~split~it~into~a~list~of~strings}

Added: trunk/py4science/workbook/introduction.tex
===
--- trunk/py4science/workbook/introduction.tex  (rev 0)
+++ trunk/py4science/workbook/introduction.tex  2007-12-03 08:22:16 UTC (rev 
4556)
@@ -0,0 +1,41 @@
+\chapter*{Introduction}
+
+This book is currently a work in progress, and ultimately we hope it will
+evolve into an open, community-driven document developed in tandem with the
+underlying tools, by the same scientists who have written them.
+
+The book is aimed at practicing scientists, students and in general anyone who
+is looking for a modern, high-level and open platform for scientific
+computing.  The Python language is in the opinion of the authors the leading
+candidate today for this role.
+
+The book is broadly divided in two parts: the first is a general discussion of
+the Python tools used for scientific work, with an explanatory approach.  It is
+not a complete Python reference book, as there are many excellent resources for
+the base language, both in print and online.  But beyond the basic language and
+the NumPy book, it should serve as reasonably self-contained description of the
+core libraries for common numerical tasks.
+
+The second part is meant as a practical workbook, and the build system used to
+produce the document will in the future allow users to create custom versions
+with only the examples that they deem practical for any given audience.  This
+workbook approach grew out of a sequence of workshops taught by the editors at
+a number of research institutions and universities, and we've found it to be
+extremely convenient.
+
+The workbook is structured as a collection of problems, meant to be solved by
+the reader as programming exercises.  The entire book can be compiled in one of
+two forms: either with the examples in `skeleton' form, where they contain
+incomplete code meant to be filled in, or with the full solution code.  This
+should enable instructors to hand out the skeleton workbook at courses and
+workshops, with the solutions being available as well for after the teaching is
+over.
+
+We hope that the community will continue to contribute many more examples, so
+that ultimately the projects allows for the easy construction of custom
+workbooks tailored to the needs of different audiences.
+
+\begin{flushright}
+John D. Hunter and Fernando P\xE9rez, editors.
+
+\end{flushright}

Modified: trunk/py4science/workbook/ipython_tut.tex
===
--- trunk/py4science/workbook/ipython_tut.tex   2007-12-03 04:56:57 UTC (rev 
4555)
+++ trunk/py4science/workbook/ipython_tut.tex   2007-12-03 08:22:16 UTC (rev 
4556)
@@ -1020,8 +1020,6 @@
 \item \texttt{\$HOME/.ipython/ipythonrc}: load basic things you always want. 
 \item \texttt{\$HOME/.ipython/ipythonrc-math}: load (1) and basic math-related
 modules. 
-\item \texttt{\$HOME/.ipython/ip

SF.net SVN: matplotlib: [4558] trunk/py4science/examples

2007-12-03 Thread jswhit
Revision: 4558
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4558&view=rev
Author:   jswhit
Date: 2007-12-03 05:27:16 -0800 (Mon, 03 Dec 2007)

Log Message:
---
more cleanups of example scripts

Modified Paths:
--
trunk/py4science/examples/basemap1.py
trunk/py4science/examples/basemap2.py
trunk/py4science/examples/basemap3.py
trunk/py4science/examples/basemap4.py
trunk/py4science/examples/basemap5.py

Modified: trunk/py4science/examples/basemap1.py
===
--- trunk/py4science/examples/basemap1.py   2007-12-03 13:20:19 UTC (rev 
4557)
+++ trunk/py4science/examples/basemap1.py   2007-12-03 13:27:16 UTC (rev 
4558)
@@ -1,12 +1,8 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-# create figure.
-fig = pylab.figure()
 # create map by specifying lat/lon values at corners.
-resolution = 'l'
-projection = 'lcc'
-lat_0 = 60
-lon_0 = -50
+resolution = 'l'; projection = 'lcc'
+lat_0 = 60; lon_0 = -50
 llcrnrlat, llcrnrlon = 8, -92
 urcrnrlat, urcrnrlon  = 39, 63
 m = Basemap(lat_0=lat_0,lon_0=lon_0,\

Modified: trunk/py4science/examples/basemap2.py
===
--- trunk/py4science/examples/basemap2.py   2007-12-03 13:20:19 UTC (rev 
4557)
+++ trunk/py4science/examples/basemap2.py   2007-12-03 13:27:16 UTC (rev 
4558)
@@ -1,14 +1,9 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-# create figure.
-fig = pylab.figure()
 # create map by specifying width and height in km.
-resolution = 'l'
-projection = 'lcc'
-lon_0 = -50
-lat_0 = 60
-width = 1200
-height = 0.75*width
+resolution = 'l'; projection = 'lcc'
+lon_0 = -50; lat_0 = 60
+width = 1200; height = 0.75*width
 m = Basemap(lon_0=lon_0,lat_0=lat_0,\
 width=width,height=height,\
 resolution=resolution,projection=projection)

Modified: trunk/py4science/examples/basemap3.py
===
--- trunk/py4science/examples/basemap3.py   2007-12-03 13:20:19 UTC (rev 
4557)
+++ trunk/py4science/examples/basemap3.py   2007-12-03 13:27:16 UTC (rev 
4558)
@@ -1,16 +1,10 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-# create figure.
-fig = pylab.figure()
 # create map by specifying width and height in km.
-resolution = 'l'
-lon_0 = -50
-lat_0 = 60
-projection = 'lcc'
-width = 1200
-height = 0.75*width
-m = Basemap(lon_0=lon_0,lat_0=lat_0,\
-width=width,height=height,\
+resolution = 'l'; projection = 'lcc'
+lon_0 = -50; lat_0 = 60
+width = 1200; height = 0.75*width
+m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height,
 resolution=resolution,projection=projection)
 # nylat, nylon are lat/lon of New York
 nylat = 40.78

Modified: trunk/py4science/examples/basemap4.py
===
--- trunk/py4science/examples/basemap4.py   2007-12-03 13:20:19 UTC (rev 
4557)
+++ trunk/py4science/examples/basemap4.py   2007-12-03 13:27:16 UTC (rev 
4558)
@@ -1,7 +1,5 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-# create figure.
-fig = pylab.figure()
 # create map by specifying width and height in km.
 resolution = 'l'
 lon_0 = -50
@@ -9,8 +7,7 @@
 projection = 'lcc'
 width = 1200
 height = 0.75*width
-m = Basemap(lon_0=lon_0,lat_0=lat_0,\
-width=width,height=height,\
+m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height,
 resolution=resolution,projection=projection)
 m.drawcoastlines(linewidth=0.5)
 m.drawmapboundary(fill_color='aqua')

Modified: trunk/py4science/examples/basemap5.py
===
--- trunk/py4science/examples/basemap5.py   2007-12-03 13:20:19 UTC (rev 
4557)
+++ trunk/py4science/examples/basemap5.py   2007-12-03 13:27:16 UTC (rev 
4558)
@@ -7,8 +7,6 @@
 sst = ncfile.variables['analysed_sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]
-# set colormap
-cmap = pylab.cm.gist_ncar
 # create Basemap instance for mollweide projection.
 # coastlines not used, so resolution set to None to skip
 # continent processing (this speeds things up a bit)
@@ -16,7 +14,7 @@
 # compute map projection coordinates of grid.
 x, y = m(*numpy.meshgrid(lons, lats))
 # plot with pcolor
-im = m.pcolormesh(x,y,sst,shading='flat',cmap=cmap)
+im = m.pcolormesh(x,y,sst,shading='flat',cmap=pylab.cm.gist_ncar)
 # draw parallels and meridians, but don't bother labelling them.
 m.drawparallels(numpy.arange(-90.,120.,30.))
 m.drawmeridians(numpy.arange(0.,420.,60.))


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future 

SF.net SVN: matplotlib: [4557] trunk/matplotlib/lib/matplotlib/mathtext.py

2007-12-03 Thread mdboom
Revision: 4557
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4557&view=rev
Author:   mdboom
Date: 2007-12-03 05:20:19 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Fix missing font file error.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/mathtext.py

Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-03 08:22:16 UTC (rev 
4556)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-03 13:20:19 UTC (rev 
4557)
@@ -16,8 +16,19 @@
 
   s = r'$\mathcal{R}\prod_{i=\alpha\mathcal{B}}^\infty a_i\sin(2 \pi f x_i)$'
 
-  The fonts \cal, \rm, \it, and \tt are allowed.
+  Different fonts may be selected:
+\mathcal  Calligraphic fonts
+\mathrm   Roman (upright) font
+\mathit   Italic font
+\mathtt   Typewriter (monospaced) font, similar to Courier
 
+  Additionally, if using the STIX fonts:
+\mathbb   Blackboard (double-struck) font
+\mathcircled  Circled characters
+\mathfrak Fraktur (Gothic-style) font
+\mathscr  Script (cursive) font
+\mathsf   Sans-serif font
+
   The following accents are provided: \hat, \breve, \grave, \bar,
   \acute, \tilde, \vec, \dot, \ddot.  All of them have the same
   syntax, eg to make an overbar you do \bar{o} or to make an o umlaut
@@ -541,10 +552,7 @@
 
 cached_font = self._fonts.get(basename)
 if cached_font is None:
-try:
-font = FT2Font(basename)
-except RuntimeError:
-return None
+font = FT2Font(basename)
 cached_font = self.CachedFont(font)
 self._fonts[basename] = cached_font
 self._fonts[font.postscript_name] = cached_font
@@ -652,13 +660,20 @@
 if fontname in self.fontmap and latex_to_bakoma.has_key(sym):
 basename, num = latex_to_bakoma[sym]
 slanted = (basename == "cmmi10") or sym in self._slanted_symbols
-cached_font = self._get_font(basename)
-symbol_name = cached_font.font.get_glyph_name(num)
-num = cached_font.glyphmap[num]
+try:
+cached_font = self._get_font(basename)
+except RuntimeError:
+pass
+else:
+symbol_name = cached_font.font.get_glyph_name(num)
+num = cached_font.glyphmap[num]
 elif len(sym) == 1:
 slanted = (fontname == "it")
-cached_font = self._get_font(fontname)
-if cached_font is not None:
+try:
+cached_font = self._get_font(fontname)
+except RuntimeError:
+pass
+else:
 num = ord(sym)
 gid = cached_font.charmap.get(num)
 if gid is not None:
@@ -795,9 +810,12 @@
 new_fontname = 'rm'
 
 slanted = (new_fontname == 'it') or sym in self._slanted_symbols
-cached_font = self._get_font(new_fontname)
 found_symbol = False
-if cached_font is not None:
+try:
+cached_font = self._get_font(new_fontname)
+except RuntimeError:
+pass
+else:
 try:
 glyphindex = cached_font.charmap[uniindex]
 found_symbol = True


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4559] trunk/py4science/examples/skel

2007-12-03 Thread jswhit
Revision: 4559
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4559&view=rev
Author:   jswhit
Date: 2007-12-03 06:41:11 -0800 (Mon, 03 Dec 2007)

Log Message:
---
cleanup basemap examples.

Modified Paths:
--
trunk/py4science/examples/skel/basemap1_skel.py
trunk/py4science/examples/skel/basemap2_skel.py
trunk/py4science/examples/skel/basemap3_skel.py
trunk/py4science/examples/skel/basemap4_skel.py
trunk/py4science/examples/skel/basemap5_skel.py

Modified: trunk/py4science/examples/skel/basemap1_skel.py
===
--- trunk/py4science/examples/skel/basemap1_skel.py 2007-12-03 13:27:16 UTC 
(rev 4558)
+++ trunk/py4science/examples/skel/basemap1_skel.py 2007-12-03 14:41:11 UTC 
(rev 4559)
@@ -1,8 +1,5 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-
-# create figure.
-fig = pylab.figure()
 # create map by specifying lat/lon values at corners.
 projection = 'lcc' # map projection 
 resolution = XX # resolution of boundaries ('c','l','i',or 'h')

Modified: trunk/py4science/examples/skel/basemap2_skel.py
===
--- trunk/py4science/examples/skel/basemap2_skel.py 2007-12-03 13:27:16 UTC 
(rev 4558)
+++ trunk/py4science/examples/skel/basemap2_skel.py 2007-12-03 14:41:11 UTC 
(rev 4559)
@@ -1,8 +1,5 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap, supported_projections
-
-# create figure.
-fig = pylab.figure()
 # create map by specifying width and height in km.
 projection = XX # map projection  ('lcc','stere','laea','aea' etc)
 # 'print supported_projections' gives a list

Modified: trunk/py4science/examples/skel/basemap3_skel.py
===
--- trunk/py4science/examples/skel/basemap3_skel.py 2007-12-03 13:27:16 UTC 
(rev 4558)
+++ trunk/py4science/examples/skel/basemap3_skel.py 2007-12-03 14:41:11 UTC 
(rev 4559)
@@ -1,27 +1,15 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-
-# create figure.
-# background color will be used for 'wet' areas.
-fig = pylab.figure()
 # create map by specifying width and height in km.
-resolution = 'l'
-lon_0 = -50
-lat_0 = 60
-projection = 'lcc'
-width = 1200
-height = 0.75*width
-m = Basemap(lon_0=lon_0,lat_0=lat_0,\
-width=width,height=height,\
+resolution = 'l'; projection='lcc'
+lon_0 = -50; lat_0 = 60.
+width = 1200; height = 0.75*width
+m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height,\
 resolution=resolution,projection=projection)
 # lat/lon and name of location 1.
-lat1 = XX
-lon1 = XX
-name1 = XX
+lat1 = XX; lon1 = XX; name = XX
 # ditto for location 2.
-lat2 = XX
-lon2 = XX
-name2 = XX
+lat2 = XX; lon2 = XX; name2 = XX
 # convert these points to map projection coordinates
 # (using __call__ method of Basemap instance)
 x1, y1 = m(lon1, lat1)

Modified: trunk/py4science/examples/skel/basemap4_skel.py
===
--- trunk/py4science/examples/skel/basemap4_skel.py 2007-12-03 13:27:16 UTC 
(rev 4558)
+++ trunk/py4science/examples/skel/basemap4_skel.py 2007-12-03 14:41:11 UTC 
(rev 4559)
@@ -1,16 +1,10 @@
 import pylab, numpy
 from matplotlib.toolkits.basemap import Basemap
-# create figure.
-fig = pylab.figure()
 # create map by specifying width and height in km.
-resolution = 'l'
-lon_0 = -50
-lat_0 = 60
-projection = 'lcc'
-width = 1200
-height = 0.75*width
-m = Basemap(lon_0=lon_0,lat_0=lat_0,\
-width=width,height=height,\
+resolution = 'l'; projection='lcc'
+lon_0 = -50; lat_0 = 60.
+width = 1200; height = 0.75*width
+m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height,\
 resolution=resolution,projection=projection)
 m.drawcoastlines(linewidth=0.5)
 m.drawmapboundary(fill_color='aqua')

Modified: trunk/py4science/examples/skel/basemap5_skel.py
===
--- trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 13:27:16 UTC 
(rev 4558)
+++ trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 14:41:11 UTC 
(rev 4559)
@@ -1,16 +1,13 @@
 from matplotlib.toolkits.basemap import Basemap, NetCDFFile, cm
 import pylab, numpy
-
 # read in netCDF sea-surface temperature data
 # can be a local file, a URL for a remote opendap dataset,
 # or (if PyNIO is installed) a GRIB or HDF file.
+# See http://nomads.ncdc.noaa.gov/ for some NOAA OPenDAP datasets.
 ncfile = NetCDFFile('data/sst.nc')
 sst = ncfile.variables['analysed_sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]
-
-print sst.shape, sst.min(), sst.max()
-
 # Basemap comes with extra colormaps from Generic Mapping Tools
 # (imported as cm, pylab colormaps in pylab.cm)
 cmap = XX
@@ -23,6 +20,8 @@
 x, y = m(*numpy.meshgrid(lons, lat

SF.net SVN: matplotlib: [4562] branches/transforms

2007-12-03 Thread mdboom
Revision: 4562
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4562&view=rev
Author:   mdboom
Date: 2007-12-03 07:27:33 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Merged revisions 4506-4561 via svnmerge from 
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib


  r4507 | jdh2358 | 2007-11-29 15:16:48 -0500 (Thu, 29 Nov 2007) | 2 lines
  
  Applied Ludwigs build tkagg w/o x11 server patch

  r4509 | jdh2358 | 2007-11-29 17:19:26 -0500 (Thu, 29 Nov 2007) | 2 lines
  
  commited ludwigs axes3d patch

  r4512 | cmoad | 2007-11-29 21:40:30 -0500 (Thu, 29 Nov 2007) | 1 line
  
  minor rev bump

  r4513 | cmoad | 2007-11-29 21:41:01 -0500 (Thu, 29 Nov 2007) | 1 line
  
  minor rev bump

  r4514 | cmoad | 2007-11-29 21:47:06 -0500 (Thu, 29 Nov 2007) | 1 line
  
  minor rev bump

  r4515 | cmoad | 2007-11-29 22:42:35 -0500 (Thu, 29 Nov 2007) | 1 line
  
  CXX/WrapPython.h missing from MANIFEST

  r4516 | cmoad | 2007-11-29 23:00:16 -0500 (Thu, 29 Nov 2007) | 1 line
  
  ttconv missing from MANFEST

  r4517 | cmoad | 2007-11-29 23:09:48 -0500 (Thu, 29 Nov 2007) | 1 line
  
  added setup.cfg.template

  r4532 | mdboom | 2007-11-30 14:48:41 -0500 (Fri, 30 Nov 2007) | 2 lines
  
  Fix mathtext in example.

  r4537 | astraw | 2007-12-01 15:12:05 -0500 (Sat, 01 Dec 2007) | 2 lines
  
  Fix loading of AAPL data in get_two_stock_data()

  r4557 | mdboom | 2007-12-03 08:20:19 -0500 (Mon, 03 Dec 2007) | 2 lines
  
  Fix missing font file error.

  r4560 | jdh2358 | 2007-12-03 10:23:32 -0500 (Mon, 03 Dec 2007) | 2 lines
  
  fixed a gtk import else block in mlab

  r4561 | mdboom | 2007-12-03 10:23:47 -0500 (Mon, 03 Dec 2007) | 3 lines
  
  Remove paragraph about MATPLOTLIBDATA environment variable, since it
  doesn't really apply anymore.


Modified Paths:
--
branches/transforms/API_CHANGES
branches/transforms/CHANGELOG
branches/transforms/CODING_GUIDE
branches/transforms/INSTALL
branches/transforms/MANIFEST.in
branches/transforms/examples/data_helper.py
branches/transforms/examples/loadrec.py
branches/transforms/examples/text_themes.py
branches/transforms/lib/matplotlib/__init__.py
branches/transforms/lib/matplotlib/axes3d.py
branches/transforms/lib/matplotlib/mathtext.py
branches/transforms/setupext.py

Property Changed:

branches/transforms/


Property changes on: branches/transforms
___
Name: svnmerge-integrated
   - /trunk/matplotlib:1-4505
   + /trunk/matplotlib:1-4561

Modified: branches/transforms/API_CHANGES
===
--- branches/transforms/API_CHANGES 2007-12-03 15:23:47 UTC (rev 4561)
+++ branches/transforms/API_CHANGES 2007-12-03 15:27:33 UTC (rev 4562)
@@ -169,6 +169,8 @@
 
 END OF TRANSFORMS REFACTORING
 
+0.91.1 Released
+
 0.91.0 Released
 
 Changed cbook.is_file_like to cbook.is_writable_file_like and

Modified: branches/transforms/CHANGELOG
===
--- branches/transforms/CHANGELOG   2007-12-03 15:23:47 UTC (rev 4561)
+++ branches/transforms/CHANGELOG   2007-12-03 15:27:33 UTC (rev 4562)
@@ -1,4 +1,7 @@
 ===
+2007-11-27 Released 0.91.1 at revision 4517
+
+===
 2007-11-27 Released 0.91.0 at revision 4478
 
 2007-11-13 All backends now support writing to a file-like object, not

Modified: branches/transforms/CODING_GUIDE
===
--- branches/transforms/CODING_GUIDE2007-12-03 15:23:47 UTC (rev 4561)
+++ branches/transforms/CODING_GUIDE2007-12-03 15:27:33 UTC (rev 4562)
@@ -117,7 +117,7 @@
 
 
 
-for older versions of emacs (emacs<22) you may need to do
+for older versions of emacs (emacs<22) you need to do
 
 (add-hook 'python-mode-hook
   (lambda ()

Modified: branches/transforms/INSTALL
===
--- branches/transforms/INSTALL 2007-12-03 15:23:47 UTC (rev 4561)
+++ branches/transforms/INSTALL 2007-12-03 15:27:33 UTC (rev 4562)
@@ -14,7 +14,7 @@
   more.  If you want to produce PNGs or GUI images that support all of
   matplotlib's features, you should compile matplotlib with agg
   support and use one of the GUI agg backends: GTKAgg, WXAgg, TkAgg or
-  FLTKAgg.   
+  FLTKAgg.
 
 COMPILING
 
@@ -36,7 +36,7 @@
   As discussed above, most users will want to set 'BUILD_AGG = 1' and
   one or more of the GUI backends to True.  Exceptions to this are if
   you know you don't need a GUI (eg a web server) or you only want to
-  produce vector graphics. 
+  produce vector graphics.
 
   If you have installed prerequisites to nonstandard p

SF.net SVN: matplotlib: [4560] trunk/matplotlib/lib/matplotlib/mlab.py

2007-12-03 Thread jdh2358
Revision: 4560
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4560&view=rev
Author:   jdh2358
Date: 2007-12-03 07:23:32 -0800 (Mon, 03 Dec 2007)

Log Message:
---
fixed a gtk import else block in mlab

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/mlab.py

Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===
--- trunk/matplotlib/lib/matplotlib/mlab.py 2007-12-03 14:41:11 UTC (rev 
4559)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-12-03 15:23:32 UTC (rev 
4560)
@@ -2441,9 +2441,9 @@
 pass
 except RuntimeError:
 pass
+else:
 
 
-
 def gtkformat_factory(format, colnum):
 """
 copy the format, perform any overrides, and attach an gtk style attrs


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4561] trunk/matplotlib/INSTALL

2007-12-03 Thread mdboom
Revision: 4561
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4561&view=rev
Author:   mdboom
Date: 2007-12-03 07:23:47 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Remove paragraph about MATPLOTLIBDATA environment variable, since it
doesn't really apply anymore.

Modified Paths:
--
trunk/matplotlib/INSTALL

Modified: trunk/matplotlib/INSTALL
===
--- trunk/matplotlib/INSTALL2007-12-03 15:23:32 UTC (rev 4560)
+++ trunk/matplotlib/INSTALL2007-12-03 15:23:47 UTC (rev 4561)
@@ -14,7 +14,7 @@
   more.  If you want to produce PNGs or GUI images that support all of
   matplotlib's features, you should compile matplotlib with agg
   support and use one of the GUI agg backends: GTKAgg, WXAgg, TkAgg or
-  FLTKAgg.   
+  FLTKAgg.
 
 COMPILING
 
@@ -36,7 +36,7 @@
   As discussed above, most users will want to set 'BUILD_AGG = 1' and
   one or more of the GUI backends to True.  Exceptions to this are if
   you know you don't need a GUI (eg a web server) or you only want to
-  produce vector graphics. 
+  produce vector graphics.
 
   If you have installed prerequisites to nonstandard places and need
   to inform matplotlib where they are, edit setupext.py an add the
@@ -53,16 +53,12 @@
   with matplotlib, it is important that you have *both* present and in
   your PYTHONPATH when you compile matplotlib.
 
-  Note that if you install matplotlib anywhere other than the default
-  location, you will need to set the MATPLOTLIBDATA environment
-  variable to point to the install base dir.
- 
   Once you have everything above set to your liking, just do the usual
   thing
 
   python setup.py build
   python setup.py install
-
+
 WINDOWS
 
   If you don't already have python installed, you may want to consider
@@ -106,7 +102,7 @@
 To build all the backends on a binary linux distro such as redhat,
 you need to install a number of the devel libs (and whatever
 dependencies they require), I suggest
- 
+
   matplotlib core: zlib, zlib-devel, libpng, libpng-devel,
freetype, freetype-devel, freetype-utils
 
@@ -134,7 +130,7 @@
 http://www.freshports.org/math/py-matplotlib/
 
   Gentoo
- 
+
 http://www.gentoo-portage.com/dev-python/matplotlib
 
   OS X


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4563] trunk/py4science/examples/skel/basemap5_skel .py

2007-12-03 Thread jswhit
Revision: 4563
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4563&view=rev
Author:   jswhit
Date: 2007-12-03 07:49:35 -0800 (Mon, 03 Dec 2007)

Log Message:
---
add an OPenDAP example URL

Modified Paths:
--
trunk/py4science/examples/skel/basemap5_skel.py

Modified: trunk/py4science/examples/skel/basemap5_skel.py
===
--- trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 15:27:33 UTC 
(rev 4562)
+++ trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 15:49:35 UTC 
(rev 4563)
@@ -5,6 +5,9 @@
 # or (if PyNIO is installed) a GRIB or HDF file.
 # See http://nomads.ncdc.noaa.gov/ for some NOAA OPenDAP datasets.
 ncfile = NetCDFFile('data/sst.nc')
+# this will produce a very similar plot, but will read
+# the data over the web instead of from a local file.
+#ncfile = 
NetCDFFile('http://nomads.ncdc.noaa.gov:8085/thredds/dodsC/oisst/2007/AVHRR/sst4-navy-eot.20071201.nc')
 sst = ncfile.variables['analysed_sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4564] trunk/py4science/examples/skel/basemap5_skel .py

2007-12-03 Thread jswhit
Revision: 4564
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4564&view=rev
Author:   jswhit
Date: 2007-12-03 08:08:12 -0800 (Mon, 03 Dec 2007)

Log Message:
---
include OPenDAP URL

Modified Paths:
--
trunk/py4science/examples/skel/basemap5_skel.py

Modified: trunk/py4science/examples/skel/basemap5_skel.py
===
--- trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 15:49:35 UTC 
(rev 4563)
+++ trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 16:08:12 UTC 
(rev 4564)
@@ -5,10 +5,12 @@
 # or (if PyNIO is installed) a GRIB or HDF file.
 # See http://nomads.ncdc.noaa.gov/ for some NOAA OPenDAP datasets.
 ncfile = NetCDFFile('data/sst.nc')
-# this will produce a very similar plot, but will read
+sst = ncfile.variables['analysed_sst'][:]
+# uncommenting the next two lines will 
+# produce a very similar plot, but will read
 # the data over the web instead of from a local file.
 #ncfile = 
NetCDFFile('http://nomads.ncdc.noaa.gov:8085/thredds/dodsC/oisst/2007/AVHRR/sst4-navy-eot.20071201.nc')
-sst = ncfile.variables['analysed_sst'][:]
+#sst = ncfile.variables['sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]
 # Basemap comes with extra colormaps from Generic Mapping Tools
@@ -18,7 +20,7 @@
 projection = XX # try moll, robin, sinu or ortho.
 # coastlines not used, so resolution set to None to skip
 # continent processing (this speeds things up a bit)
-m = Basemap(projection=projection,lon_0=0,lat_0=0,resolution=None)
+m = Basemap(projection=projection,lon_0=lons.mean(),lat_0=0,resolution=None)
 # compute map projection coordinates of grid.
 x, y = m(*numpy.meshgrid(lons, lats))
 # plot with pcolor


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4565] branches/transforms/src/_backend_agg.cpp

2007-12-03 Thread mdboom
Revision: 4565
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4565&view=rev
Author:   mdboom
Date: 2007-12-03 09:14:20 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Fix bug in pcolormesh.

Modified Paths:
--
branches/transforms/src/_backend_agg.cpp

Modified: branches/transforms/src/_backend_agg.cpp
===
--- branches/transforms/src/_backend_agg.cpp2007-12-03 16:08:12 UTC (rev 
4564)
+++ branches/transforms/src/_backend_agg.cpp2007-12-03 17:14:20 UTC (rev 
4565)
@@ -1145,7 +1145,7 @@
 inline unsigned vertex(unsigned idx, double* x, double* y) {
   size_t m = (idx   & 0x2) ? (m_m + 1) : m_m;
   size_t n = (idx+1 & 0x2) ? (m_n + 1) : m_n;
-  double* pair = (double*)PyArray_GETPTR2(m_coordinates, m, n);
+  double* pair = (double*)PyArray_GETPTR2(m_coordinates, n, m);
   *x = *pair++;
   *y = *pair;
   return (idx) ? agg::path_cmd_line_to : agg::path_cmd_move_to;
@@ -1172,7 +1172,7 @@
 
   inline QuadMeshGenerator(size_t meshWidth, size_t meshHeight, const 
Py::Object& coordinates) :
 m_meshWidth(meshWidth), m_meshHeight(meshHeight), m_coordinates(NULL) {
-PyArrayObject* coordinates_array = 
(PyArrayObject*)PyArray_FromObject(coordinates.ptr(), PyArray_DOUBLE, 1, 3);
+PyArrayObject* coordinates_array = 
(PyArrayObject*)PyArray_FromObject(coordinates.ptr(), PyArray_DOUBLE, 3, 3);
 if (!coordinates_array) {
   throw Py::ValueError("Invalid coordinates array.");
 }
@@ -1189,7 +1189,7 @@
   }
 
   inline path_iterator operator()(size_t i) const {
-return QuadMeshPathIterator(i % m_meshHeight, i / m_meshHeight, 
m_coordinates);
+return QuadMeshPathIterator(i % m_meshWidth, i / m_meshWidth, 
m_coordinates);
   }
 };
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4566] branches/transforms/examples/quadmesh_demo. py

2007-12-03 Thread mdboom
Revision: 4566
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4566&view=rev
Author:   mdboom
Date: 2007-12-03 09:15:06 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Use non-equal dimensions for mesh to highlight bug in pcolormesh (if
it ever returns).

Modified Paths:
--
branches/transforms/examples/quadmesh_demo.py

Modified: branches/transforms/examples/quadmesh_demo.py
===
--- branches/transforms/examples/quadmesh_demo.py   2007-12-03 17:14:20 UTC 
(rev 4565)
+++ branches/transforms/examples/quadmesh_demo.py   2007-12-03 17:15:06 UTC 
(rev 4566)
@@ -13,7 +13,8 @@
 
 n = 56
 x = npy.linspace(-1.5,1.5,n)
-X,Y = npy.meshgrid(x,x);
+y = npy.linspace(-1.5,1.5,n*2)
+X,Y = npy.meshgrid(x,y);
 Qx = npy.cos(Y) - npy.cos(X)
 Qz = npy.sin(Y) + npy.sin(X)
 Qx = (Qx + 1.1)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4567] trunk/py4science/examples

2007-12-03 Thread jswhit
Revision: 4567
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4567&view=rev
Author:   jswhit
Date: 2007-12-03 09:30:46 -0800 (Mon, 03 Dec 2007)

Log Message:
---
update basemap example

Modified Paths:
--
trunk/py4science/examples/basemap5.py
trunk/py4science/examples/data/sst.nc
trunk/py4science/examples/skel/basemap5_skel.py

Modified: trunk/py4science/examples/basemap5.py
===
--- trunk/py4science/examples/basemap5.py   2007-12-03 17:15:06 UTC (rev 
4566)
+++ trunk/py4science/examples/basemap5.py   2007-12-03 17:30:46 UTC (rev 
4567)
@@ -4,7 +4,7 @@
 # can be a local file, a URL for a remote opendap dataset,
 # or (if PyNIO is installed) a GRIB or HDF file.
 ncfile = NetCDFFile('data/sst.nc')
-sst = ncfile.variables['analysed_sst'][:]
+sst = ncfile.variables['sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]
 # create Basemap instance for mollweide projection.

Modified: trunk/py4science/examples/data/sst.nc
===
(Binary files differ)

Modified: trunk/py4science/examples/skel/basemap5_skel.py
===
--- trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 17:15:06 UTC 
(rev 4566)
+++ trunk/py4science/examples/skel/basemap5_skel.py 2007-12-03 17:30:46 UTC 
(rev 4567)
@@ -5,12 +5,10 @@
 # or (if PyNIO is installed) a GRIB or HDF file.
 # See http://nomads.ncdc.noaa.gov/ for some NOAA OPenDAP datasets.
 ncfile = NetCDFFile('data/sst.nc')
-sst = ncfile.variables['analysed_sst'][:]
-# uncommenting the next two lines will 
-# produce a very similar plot, but will read
-# the data over the web instead of from a local file.
+# uncommenting the next line will produce a very similar plot,
+# but will read the data over the web instead of from a local file. 
 #ncfile = 
NetCDFFile('http://nomads.ncdc.noaa.gov:8085/thredds/dodsC/oisst/2007/AVHRR/sst4-navy-eot.20071201.nc')
-#sst = ncfile.variables['sst'][:]
+sst = ncfile.variables['sst'][:]
 lats = ncfile.variables['lat'][:]
 lons = ncfile.variables['lon'][:]
 # Basemap comes with extra colormaps from Generic Mapping Tools


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4568] branches/transforms

2007-12-03 Thread mdboom
Revision: 4568
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4568&view=rev
Author:   mdboom
Date: 2007-12-03 11:07:36 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Fix image interpolation edges for Agg 2.4.  It no longer needs funny
workarounds with memory copies to interpolate the edges of the image correctly.

Modified Paths:
--
branches/transforms/lib/matplotlib/image.py
branches/transforms/src/_image.cpp

Modified: branches/transforms/lib/matplotlib/image.py
===
--- branches/transforms/lib/matplotlib/image.py 2007-12-03 17:30:46 UTC (rev 
4567)
+++ branches/transforms/lib/matplotlib/image.py 2007-12-03 19:07:36 UTC (rev 
4568)
@@ -156,9 +156,6 @@
 sx = dxintv/self.axes.viewLim.width
 sy = dyintv/self.axes.viewLim.height
 
-if im.get_interpolation()!=_image.NEAREST:
-im.apply_translation(-1, -1)
-
 # the viewport translation
 tx = (xmin-self.axes.viewLim.x0)/dxintv * numcols
 ty = (ymin-self.axes.viewLim.y0)/dyintv * numrows
@@ -382,7 +379,7 @@
 if s != None and s != 'nearest':
 raise NotImplementedError('Only nearest neighbor supported')
 AxesImage.set_interpolation(self, s)
-
+
 def get_extent(self):
 if self._A is None:
 raise RuntimeError('Must set data first')

Modified: branches/transforms/src/_image.cpp
===
--- branches/transforms/src/_image.cpp  2007-12-03 17:30:46 UTC (rev 4567)
+++ branches/transforms/src/_image.cpp  2007-12-03 19:07:36 UTC (rev 4568)
@@ -379,57 +379,11 @@
 
   double x0, y0, x1, y1;
 
-  if (interpolation==NEAREST) {
-x0 = 0.0;
-x1 = colsIn;
-y0 = 0.0;
-y1 = rowsIn;
-  }
-  else {
-// if interpolation != nearest, create a new input buffer with the
-// edges mirrored on all size.  Then new buffer size is colsIn+2 by
-// rowsIn+2
+  x0 = 0.0;
+  x1 = colsIn;
+  y0 = 0.0;
+  y1 = rowsIn;
 
-x0 = 1.0;
-x1 = colsIn+1;
-y0 = 1.0;
-y1 = rowsIn+1;
-
-
-bufferPad = new agg::int8u[(rowsIn+2) * (colsIn+2) * BPP];
-if (bufferPad ==NULL)
-  throw Py::MemoryError("Image::resize could not allocate memory");
-rbufPad.attach(bufferPad, colsIn+2, rowsIn+2, (colsIn+2) * BPP);
-
-pixfmt pixfpad(rbufPad);
-renderer_base rbpad(pixfpad);
-
-pixfmt pixfin(*rbufIn);
-renderer_base rbin(pixfin);
-
-rbpad.copy_from(*rbufIn, 0, 1, 1);
-
-agg::rect_base firstrow(0, 0, colsIn-1, 0);
-rbpad.copy_from(*rbufIn, &firstrow, 1, 0);
-
-agg::rect_base lastrow(0, rowsIn-1, colsIn-1, rowsIn-1);
-rbpad.copy_from(*rbufIn, &lastrow, 1, 2);
-
-agg::rect_base firstcol(0, 0, 0, rowsIn-1);
-rbpad.copy_from(*rbufIn, &firstcol, 0, 1);
-
-agg::rect_base lastcol(colsIn-1, 0, colsIn-1, rowsIn-1);
-rbpad.copy_from(*rbufIn, &lastcol, 2, 1);
-
-rbpad.copy_pixel(0, 0, rbin.pixel(0,0) );
-rbpad.copy_pixel(0, colsIn+1, rbin.pixel(0,colsIn-1) );
-rbpad.copy_pixel(rowsIn+1, 0, rbin.pixel(rowsIn-1,0) );
-rbpad.copy_pixel(rowsIn+1, colsIn+1, rbin.pixel(rowsIn-1,colsIn-1) );
-
-
-  }
-
-
   path.move_to(x0, y0);
   path.line_to(x1, y0);
   path.line_to(x1, y1);
@@ -439,7 +393,7 @@
   ras.add_path(imageBox);
 
   typedef agg::image_accessor_clip img_accessor_type;
-   
+
   pixfmt pixfmtin(*rbufIn);
   img_accessor_type ia(pixfmtin, background);
   switch(interpolation)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4569] branches/transforms/lib/matplotlib/axes.py

2007-12-03 Thread mdboom
Revision: 4569
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4569&view=rev
Author:   mdboom
Date: 2007-12-03 11:16:17 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Fix exception when a particular contour doesn't exist.

Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py

Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py  2007-12-03 19:07:36 UTC (rev 
4568)
+++ branches/transforms/lib/matplotlib/axes.py  2007-12-03 19:16:17 UTC (rev 
4569)
@@ -1137,7 +1137,8 @@
 self._set_artist_props(collection)
 collection.set_clip_path(self.axesPatch)
 if autolim:
-self.update_datalim(collection.get_datalim(self.transData))
+if len(collection._paths):
+self.update_datalim(collection.get_datalim(self.transData))
 collection._remove_method = lambda h: self.collections.remove(h)
 
 def add_line(self, line):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4570] trunk/toolkits/basemap

2007-12-03 Thread jswhit
Revision: 4570
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4570&view=rev
Author:   jswhit
Date: 2007-12-03 14:32:28 -0800 (Mon, 03 Dec 2007)

Log Message:
---
add default for altitude of geostationary orbit in 'geos' projection.

Modified Paths:
--
trunk/toolkits/basemap/examples/geos_demo.py
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py

Modified: trunk/toolkits/basemap/examples/geos_demo.py
===
--- trunk/toolkits/basemap/examples/geos_demo.py2007-12-03 19:16:17 UTC 
(rev 4569)
+++ trunk/toolkits/basemap/examples/geos_demo.py2007-12-03 22:32:28 UTC 
(rev 4570)
@@ -3,12 +3,10 @@
 
 # create Basemap instance for Geostationary (satellite view) projection.
 lon_0 = float(raw_input('enter reference longitude (lon_0):'))
-#h = float(raw_input('enter satellite height above equator in meters 
(satellite_height):'))
-h = 35785831.0
 
 # map with land/sea mask plotted
 fig=figure()
-m = 
Basemap(projection='geos',lon_0=lon_0,satellite_height=h,rsphere=(6378137.00,6356752.3142),resolution=None)
+m = 
Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution=None)
 # plot land-sea mask.
 rgba_land = (0,255,0,255) # land green.
 rgba_ocean = (0,0,255,255) # ocean blue.
@@ -18,11 +16,11 @@
 m.drawparallels(arange(-90.,120.,30.))
 m.drawmeridians(arange(0.,420.,60.))
 m.drawmapboundary()
-title('Geostationary Map Centered on Lon=%s, Satellite Height=%s' % (lon_0,h))
+title('Geostationary Map Centered on Lon=%s' % (lon_0))
 
 # map with continents drawn and filled.
 fig = figure()
-m = 
Basemap(projection='geos',lon_0=lon_0,satellite_height=h,rsphere=(6378137.00,6356752.3142),resolution='l')
+m = 
Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution='l')
 m.drawcoastlines()
 m.drawmapboundary(fill_color='aqua')
 m.fillcontinents(color='coral',lake_color='aqua')
@@ -31,5 +29,5 @@
 m.drawparallels(arange(-90.,120.,30.))
 m.drawmeridians(arange(0.,420.,60.))
 m.drawmapboundary()
-title('Geostationary Map Centered on Lon=%s, Satellite Height=%s' % (lon_0,h))
+title('Geostationary Map Centered on Lon=%s' % (lon_0))
 show()

Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-03 19:16:17 UTC (rev 4569)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py   
2007-12-03 22:32:28 UTC (rev 4570)
@@ -212,7 +212,7 @@
   on the north or south pole.  The longitude lon_0 is at 6-o'clock, and the
   latitude circle boundinglat is tangent to the edge of the map at lon_0.
  satellite_height - height of satellite (in m) above equator -
-  only relevant for geostationary projections ('geos').
+  only relevant for geostationary projections ('geos'). Default 35,786 km.
 
  Here are the most commonly used class methods (see the docstring
  for each for more details):
@@ -324,7 +324,7 @@
lat_0=None, lon_0=None,
lon_1=None, lon_2=None,
suppress_ticks=True,
-   satellite_height=None,
+   satellite_height=35786000,
boundinglat=None,
anchor='C',
ax=None):
@@ -362,7 +362,7 @@
 _insert_validated(projparams, lon_0, 'lon_0', -360, 720)
 _insert_validated(projparams, lon_1, 'lon_1', -360, 720)
 _insert_validated(projparams, lon_2, 'lon_2', -360, 720)
-if satellite_height is not None:
+if projection == 'geos':
 projparams['h'] = satellite_height
 # check for sane values of projection corners.
 using_corners = (None not in [llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat])
@@ -488,8 +488,8 @@
 if npy.abs(lat_0) < 1.e-2: lat_0 = 1.e-2
 projparams['lat_0'] = lat_0
 elif projection == 'geos':
-if lon_0 is None and satellite_height is None:
-raise ValueError, 'must specify lon_0 and satellite_height for 
Geostationary basemap'
+if lon_0 is None:
+raise ValueError, 'must specify lon_0 for Geostationary 
basemap'
 if width is not None or height is not None:
 print 'warning: width and height keywords ignored for %s 
projection' % self.projection
 if not using_corners:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___

SF.net SVN: matplotlib: [4571] trunk/matplotlib/lib/matplotlib/backends/ backend_cocoaagg.py

2007-12-03 Thread jdh2358
Revision: 4571
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4571&view=rev
Author:   jdh2358
Date: 2007-12-03 18:06:52 -0800 (Mon, 03 Dec 2007)

Log Message:
---
applied barrys cocoaagg patch

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py
2007-12-03 22:32:28 UTC (rev 4570)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py
2007-12-04 02:06:52 UTC (rev 4571)
@@ -78,8 +78,8 @@
 self.plotWindow.setDelegate_(self)#.plotView)
 
 self.plotView.setImageFrameStyle_(NSImageFrameGroove)
-self.plotView.image = NSImage.alloc().initWithSize_((0,0))
-self.plotView.setImage_(self.plotView.image)
+self.plotView.image_ = NSImage.alloc().initWithSize_((0,0))
+self.plotView.setImage_(self.plotView.image_)
 
 # Make imageview first responder for key events
 self.plotWindow.makeFirstResponder_(self.plotView)
@@ -112,10 +112,10 @@
 w,h = self.canvas.get_width_height()
 
 # Remove all previous images
-for i in xrange(self.image.representations().count()):
-
self.image.removeRepresentation_(self.image.representations().objectAtIndex_(i))
+for i in xrange(self.image_.representations().count()):
+
self.image_.removeRepresentation_(self.image_.representations().objectAtIndex_(i))
 
-self.image.setSize_((w,h))
+self.image_.setSize_((w,h))
 
 brep = 
NSBitmapImageRep.alloc().initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_(
 (self.canvas.buffer_rgba(0,0),'','','',''), # Image data
@@ -129,7 +129,7 @@
 w*4, # row bytes
 32) # bits per pixel
 
-self.image.addRepresentation_(brep)
+self.image_.addRepresentation_(brep)
 self.setNeedsDisplay_(True)
 
 def windowDidResize_(self, sender):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4572] trunk/matplotlib/examples/hist_colormapped. py

2007-12-03 Thread jdh2358
Revision: 4572
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4572&view=rev
Author:   jdh2358
Date: 2007-12-03 19:18:39 -0800 (Mon, 03 Dec 2007)

Log Message:
---
colormapped histogram

Added Paths:
---
trunk/matplotlib/examples/hist_colormapped.py

Added: trunk/matplotlib/examples/hist_colormapped.py
===
--- trunk/matplotlib/examples/hist_colormapped.py   
(rev 0)
+++ trunk/matplotlib/examples/hist_colormapped.py   2007-12-04 03:18:39 UTC 
(rev 4572)
@@ -0,0 +1,24 @@
+import numpy as n
+from pylab import figure, show
+import matplotlib.cm as cm
+import matplotlib.colors as colors
+
+fig = figure()
+ax = fig.add_subplot(111)
+Ntotal = 1000
+N, bins, patches = ax.hist(n.random.rand(Ntotal), 20)
+
+#I'll color code by height, but you could use any scalar
+
+
+# we need to normalize the data to 0..1 for the full
+# range of the colormap
+fracs = N.astype(float)/N.max()
+norm = colors.normalize(fracs.min(), fracs.max())
+
+for thisfrac, thispatch in zip(fracs, patches):
+color = cm.jet(norm(thisfrac))
+thispatch.set_facecolor(color)
+
+
+show()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4573] trunk/py4science/workbook

2007-12-03 Thread fer_perez
Revision: 4573
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4573&view=rev
Author:   fer_perez
Date: 2007-12-03 22:24:07 -0800 (Mon, 03 Dec 2007)

Log Message:
---
Get skeleton to build correctly, rewrite makefile to do as few latex runs as 
possible

Modified Paths:
--
trunk/py4science/workbook/Makefile

Added Paths:
---
trunk/py4science/workbook/problems_skel/basemap1.py
trunk/py4science/workbook/problems_skel/basemap2.py
trunk/py4science/workbook/problems_skel/basemap3.py
trunk/py4science/workbook/problems_skel/basemap4.py
trunk/py4science/workbook/problems_skel/basemap5.py

Modified: trunk/py4science/workbook/Makefile
===
--- trunk/py4science/workbook/Makefile  2007-12-04 03:18:39 UTC (rev 4572)
+++ trunk/py4science/workbook/Makefile  2007-12-04 06:24:07 UTC (rev 4573)
@@ -1,20 +1,55 @@
-solved:
+# Makefile for the py4science book.
+
+# Dependencies
+
+# Warning: list the .aux *before* the bbl.  It's probably possible to get the
+# rules right, but I'm not sure how.
+SKEL_SRC = workbook_skeletons.aux workbook_skeletons.bbl \
+workbook_skeletons.tex main.tex
+
+SOL_SRC = $(subst _skeletons,_solved,$(SKEL_SRC))
+
+# programs
+PDFTEX = pdflatex -file-line-error
+FASTPDFTEX = pdflatex -file-line-error -draftmode -halt-on-error
+
+# convenience shorthand for targets
+sol: workbook_solved.pdf
+skel: workbook_skeletons.pdf
+all: sol skel
+
+# actual targets
+workbook_solved.pdf: $(SOL_SRC)
rm -f problems
-   ln -s problems_solved problems
-   rm -f workbook_solved.tex
-   ln -s main.tex workbook_solved.tex
-   pdflatex workbook_solved
-   bibtex workbook_solved
-   pdflatex workbook_solved
-   rm -f workbook_solved.tex
+   ln -sf problems_solved problems
+   $(PDFTEX) workbook_solved
+   $(PDFTEX) workbook_solved
 
-skeletons:
+workbook_skeletons.pdf: $(SKEL_SRC)
rm -f problems
-   ln -s problems_skel problems
-   rm -f workbook_skeletons.tex
-   ln -s main.tex workbook_skeletons.tex
-   pdflatex workbook_skeletons
-   rm -f workbook_skeletons.tex
+   ln -sf problems_skel problems
+   $(PDFTEX) workbook_skeletons
 
+workbook_skeletons.tex:
+   ln -sf main.tex workbook_skeletons.tex
+
+workbook_solved.tex:
+   ln -sf main.tex workbook_solved.tex
+
 clean:
-   rm -f *~ *.aux *.log *.toc *.out
\ No newline at end of file
+   rm -f *~ *.aux *.log *.toc *.out *.bbl *.blg
+
+distclean: clean
+   rm -f workbook_solved.pdf workbook_skeletons.pdf
+
+# Basic rules
+empty :=
+%.bbl : %.aux
+   bibtex $(subst .aux,$(empty),$<)
+   $(FASTPDFTEX) $(subst .aux,$(empty),$<)
+
+%.aux : %.tex
+   $(FASTPDFTEX) $<
+
+# Phony targets
+.PHONY: all clean

Added: trunk/py4science/workbook/problems_skel/basemap1.py
===
--- trunk/py4science/workbook/problems_skel/basemap1.py 
(rev 0)
+++ trunk/py4science/workbook/problems_skel/basemap1.py 2007-12-04 06:24:07 UTC 
(rev 4573)
@@ -0,0 +1 @@
+link ../../examples/skel/basemap1_skel.py
\ No newline at end of file


Property changes on: trunk/py4science/workbook/problems_skel/basemap1.py
___
Name: svn:special
   + *

Added: trunk/py4science/workbook/problems_skel/basemap2.py
===
--- trunk/py4science/workbook/problems_skel/basemap2.py 
(rev 0)
+++ trunk/py4science/workbook/problems_skel/basemap2.py 2007-12-04 06:24:07 UTC 
(rev 4573)
@@ -0,0 +1 @@
+link ../../examples/skel/basemap2_skel.py
\ No newline at end of file


Property changes on: trunk/py4science/workbook/problems_skel/basemap2.py
___
Name: svn:special
   + *

Added: trunk/py4science/workbook/problems_skel/basemap3.py
===
--- trunk/py4science/workbook/problems_skel/basemap3.py 
(rev 0)
+++ trunk/py4science/workbook/problems_skel/basemap3.py 2007-12-04 06:24:07 UTC 
(rev 4573)
@@ -0,0 +1 @@
+link ../../examples/skel/basemap3_skel.py
\ No newline at end of file


Property changes on: trunk/py4science/workbook/problems_skel/basemap3.py
___
Name: svn:special
   + *

Added: trunk/py4science/workbook/problems_skel/basemap4.py
===
--- trunk/py4science/workbook/problems_skel/basemap4.py 
(rev 0)
+++ trunk/py4science/workbook/problems_skel/basemap4.py 2007-12-04 06:24:07 UTC 
(rev 4573)
@@ -0,0 +1 @@
+link ../../examples/skel/basemap4_skel.py
\ No newline at end of file


Property changes on: trunk/py4science/workbook/problems_skel/basemap4.py
__

SF.net SVN: matplotlib: [4574] trunk/py4science/workbook/Makefile

2007-12-03 Thread fer_perez
Revision: 4574
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4574&view=rev
Author:   fer_perez
Date: 2007-12-03 22:46:07 -0800 (Mon, 03 Dec 2007)

Log Message:
---
small makefile fixes

Modified Paths:
--
trunk/py4science/workbook/Makefile

Modified: trunk/py4science/workbook/Makefile
===
--- trunk/py4science/workbook/Makefile  2007-12-04 06:24:07 UTC (rev 4573)
+++ trunk/py4science/workbook/Makefile  2007-12-04 06:46:07 UTC (rev 4574)
@@ -4,8 +4,10 @@
 
 # Warning: list the .aux *before* the bbl.  It's probably possible to get the
 # rules right, but I'm not sure how.
+TEXFILES = $(wildcard *.tex)
+
 SKEL_SRC = workbook_skeletons.aux workbook_skeletons.bbl \
-workbook_skeletons.tex main.tex
+workbook_skeletons.tex $(TEXFILES)
 
 SOL_SRC = $(subst _skeletons,_solved,$(SKEL_SRC))
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins