SF.net SVN: matplotlib: [5729] trunk/toolkits/basemap/doc/users

2008-07-10 Thread jswhit
Revision: 5729
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5729&view=rev
Author:   jswhit
Date: 2008-07-10 05:22:16 -0700 (Thu, 10 Jul 2008)

Log Message:
---
added tmerc and cass examples

Modified Paths:
--
trunk/toolkits/basemap/doc/users/mapsetup.rst

Added Paths:
---
trunk/toolkits/basemap/doc/users/cass.rst
trunk/toolkits/basemap/doc/users/figures/cass.py
trunk/toolkits/basemap/doc/users/figures/tmerc.py
trunk/toolkits/basemap/doc/users/tmerc.rst

Added: trunk/toolkits/basemap/doc/users/cass.rst
===
--- trunk/toolkits/basemap/doc/users/cass.rst   (rev 0)
+++ trunk/toolkits/basemap/doc/users/cass.rst   2008-07-10 12:22:16 UTC (rev 
5729)
@@ -0,0 +1,12 @@
+.. _cass:
+
+Cassini Projection
+==
+
+The transverse aspect of the equidistant cassindrical projection.
+The globe is first rotated so the central meridian becomes the "equator",
+and then the normal equidistant cylindrical projection is applied.
+
+.. literalinclude:: figures/cass.py
+
+.. image:: figures/cass.png

Added: trunk/toolkits/basemap/doc/users/figures/cass.py
===
--- trunk/toolkits/basemap/doc/users/figures/cass.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/cass.py2008-07-10 12:22:16 UTC 
(rev 5729)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'i' means use intermediate resolution coastlines.
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+m = Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5,
+resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7)
+# can get the identical map this way (by specifying width and
+# height instead of lat/lon corners)
+#m = Basemap(width=891185,height=1115557,\
+#resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-40,61.,2.))
+m.drawmeridians(np.arange(-20.,21.,2.))
+m.drawmapboundary(fill_color='aqua') 
+plt.title("Cassini Projection")
+plt.savefig('cass.png')

Added: trunk/toolkits/basemap/doc/users/figures/tmerc.py
===
--- trunk/toolkits/basemap/doc/users/figures/tmerc.py   
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/tmerc.py   2008-07-10 12:22:16 UTC 
(rev 5729)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'i' means use intermediate resolution coastlines.
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+m = Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5,
+resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7)
+# can get the identical map this way (by specifying width and
+# height instead of lat/lon corners)
+#m = Basemap(width=894887,height=1116766,\
+#resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-40,61.,2.))
+m.drawmeridians(np.arange(-20.,21.,2.))
+m.drawmapboundary(fill_color='aqua') 
+plt.title("Transverse Mercator Projection")
+plt.savefig('tmerc.png')

Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===
--- trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-09 19:34:43 UTC 
(rev 5728)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-10 12:22:16 UTC 
(rev 5729)
@@ -39,5 +39,7 @@
 robin.rst
 sinu.rst
 cyl.rst
+cass.rst
 merc.rst
+tmerc.rst
 mill.rst

Added: trunk/toolkits/basemap/doc/users/tmerc.rst
===
--- trunk/toolkits/basemap/doc/users/tmerc.rst  (rev 0)
+++ trunk/toolkits/basemap/doc/users/tmerc.rst  2008-07-10 12:22:16 UTC (rev 
5729)
@@ -0,0 +1,12 @@
+.. _tmerc:
+
+Transverse Mercator Projection
+==
+
+The transverse aspect of the mercator projection.
+The globe is first rotated so the central meridian becomes the "equator",
+and then the normal mercator projection is applied.
+
+.. literalinclude:: figures/tmerc.py
+
+.. image:: figures/tmerc.png


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

SF.net SVN: matplotlib: [5730] trunk/matplotlib

2008-07-10 Thread mdboom
Revision: 5730
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5730&view=rev
Author:   mdboom
Date: 2008-07-10 07:07:00 -0700 (Thu, 10 Jul 2008)

Log Message:
---

[ 2014183 ] multiple imshow() causes gray edges

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/src/_image.cpp

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2008-07-10 12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/CHANGELOG  2008-07-10 14:07:00 UTC (rev 5730)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
+
 2008-07-09 Fix rectangular axes patch on polar plots bug - MGD
 
 2008-07-09 Improve mathtext radical rendering - MGD

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-07-10 
12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-07-10 
14:07:00 UTC (rev 5730)
@@ -211,6 +211,11 @@
 def clear(self):
 self._renderer.clear()
 
+def option_image_nocomposite(self):
+# It is generally faster to composite each image directly to
+# the Figure, and there's no file size benefit to compositing
+# with the Agg backend
+return True
 
 
 def new_figure_manager(num, *args, **kwargs):

Modified: trunk/matplotlib/src/_image.cpp
===
--- trunk/matplotlib/src/_image.cpp 2008-07-10 12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/src/_image.cpp 2008-07-10 14:07:00 UTC (rev 5730)
@@ -742,7 +742,7 @@
   //clear the background of the rendering buffer with alpha 1 and the
   //gtkagg screen noise problem in figimage_demo.py goes away -- see
   //comment backend_gtkagg.py _render_figure method JDH
-  //rb.clear(agg::rgba(1, 1, 1, 1));
+  rb.clear(agg::rgba(1, 1, 1, 1));
 
   for (size_t imnum=0; imnum< N; imnum++) {
 tup = Py::Tuple(tups[imnum]);


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

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5731] trunk/matplotlib

2008-07-10 Thread mdboom
Revision: 5731
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5731&view=rev
Author:   mdboom
Date: 2008-07-10 07:13:07 -0700 (Thu, 10 Jul 2008)

Log Message:
---
[ 2013963 ] update_datalim_bounds in Axes not works

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2008-07-10 14:07:00 UTC (rev 5730)
+++ trunk/matplotlib/CHANGELOG  2008-07-10 14:13:07 UTC (rev 5731)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
+
 2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
 
 2008-07-09 Fix rectangular axes patch on polar plots bug - MGD

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-10 14:07:00 UTC (rev 
5730)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-10 14:13:07 UTC (rev 
5731)
@@ -1394,7 +1394,7 @@
 Update the datalim to include the given
 :class:`~matplotlib.transforms.Bbox` *bounds*
 '''
-self.dataLim.set(Bbox.union([self.dataLim, bounds]))
+self.dataLim.set(mtransforms.Bbox.union([self.dataLim, bounds]))
 
 def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
 'look for unit *kwargs* and update the axis instances as necessary'


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

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5732] trunk/matplotlib

2008-07-10 Thread mdboom
Revision: 5732
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5732&view=rev
Author:   mdboom
Date: 2008-07-10 08:45:15 -0700 (Thu, 10 Jul 2008)

Log Message:
---
Bugfix: crash displaying fontconfig pattern

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2008-07-10 14:13:07 UTC (rev 5731)
+++ trunk/matplotlib/CHANGELOG  2008-07-10 15:45:15 UTC (rev 5732)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: crash displaying fontconfig pattern - MGD
+
 2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
 
 2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD

Modified: trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py
===
--- trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py   2008-07-10 
14:13:07 UTC (rev 5731)
+++ trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py   2008-07-10 
15:45:15 UTC (rev 5732)
@@ -123,23 +123,23 @@
 return props
 
 def _family(self, s, loc, tokens):
-return [family_unescape(r'\1', tokens[0])]
+return [family_unescape(r'\1', str(tokens[0]))]
 
 def _size(self, s, loc, tokens):
 return [float(tokens[0])]
 
 def _name(self, s, loc, tokens):
-return [tokens[0]]
+return [str(tokens[0])]
 
 def _value(self, s, loc, tokens):
-return [value_unescape(r'\1', tokens[0])]
+return [value_unescape(r'\1', str(tokens[0]))]
 
 def _families(self, s, loc, tokens):
-self._properties['family'] = tokens
+self._properties['family'] = [str(x) for x in tokens]
 return []
 
 def _point_sizes(self, s, loc, tokens):
-self._properties['size'] = tokens
+self._properties['size'] = [str(x) for x in tokens]
 return []
 
 def _property(self, s, loc, tokens):
@@ -161,10 +161,13 @@
 props = []
 families = ''
 size = ''
-for key, val in d.items():
+for key in 'family style variant weight stretch file size'.split():
+val = getattr(d, 'get_' + key)()
 if val is not None and val != []:
-val = [value_escape(r'\\\1', str(x)) for x in val if x is not None]
-if val != []:
-val = ','.join(val)
-props.append(":%s=%s" % (key, val))
+if type(val) == list:
+val = [value_escape(r'\\\1', str(x)) for x in val if x is not 
None]
+if val != []:
+val = ','.join(val)
+props.append(":%s=%s" % (key, val))
+print parse_fontconfig_pattern(''.join(props))
 return ''.join(props)


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

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5733] trunk/matplotlib/src

2008-07-10 Thread mdboom
Revision: 5733
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5733&view=rev
Author:   mdboom
Date: 2008-07-10 11:12:50 -0700 (Thu, 10 Jul 2008)

Log Message:
---
Add some range checking based on testing in Fusil.

Modified Paths:
--
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_image.cpp

Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp   2008-07-10 15:45:15 UTC (rev 
5732)
+++ trunk/matplotlib/src/_backend_agg.cpp   2008-07-10 18:12:50 UTC (rev 
5733)
@@ -1611,10 +1611,26 @@
   if ( kws.hasKey("debug") ) debug = Py::Int( kws["debug"] );
   else debug=0;
 
-  int width = Py::Int(args[0]);
-  int height = Py::Int(args[1]);
+  unsigned int width = (unsigned int)Py::Int(args[0]);
+  unsigned int height = (unsigned int)Py::Int(args[1]);
   double dpi = Py::Float(args[2]);
-  return Py::asObject(new RendererAgg(width, height, dpi, debug));
+
+  if (width > 1 << 15 || height > 1 << 15) {
+throw Py::ValueError("width and height must each be below 32768");
+  }
+
+  if (dpi <= 0.0) {
+throw Py::ValueError("dpi must be positive");
+  }
+
+  RendererAgg* renderer = NULL;
+  try {
+renderer = new RendererAgg(width, height, dpi, debug);
+  } catch (std::bad_alloc) {
+throw Py::RuntimeError("Could not allocate memory for image");
+  }
+
+  return Py::asObject(renderer);
 }
 
 

Modified: trunk/matplotlib/src/_image.cpp
===
--- trunk/matplotlib/src/_image.cpp 2008-07-10 15:45:15 UTC (rev 5732)
+++ trunk/matplotlib/src/_image.cpp 2008-07-10 18:12:50 UTC (rev 5733)
@@ -708,9 +708,13 @@
 
   args.verify_length(3);
 
-  size_t numrows = Py::Int(args[0]);
-  size_t numcols = Py::Int(args[1]);
+  size_t numrows = (size_t)Py::Int(args[0]);
+  size_t numcols = (size_t)Py::Int(args[1]);
 
+  if (numrows > 1 << 15 || numcols > 1 << 15) {
+throw Py::RuntimeError("numrows and numcols must both be less than 32768");
+  }
+
   Py::SeqBase tups = args[2];
   size_t N = tups.length();
 
@@ -1084,8 +1088,13 @@
   args.verify_length(4);
 
   PyObject *bufin = new_reference_to(args[0]);
-  int x = Py::Int(args[1]);
-  int y = Py::Int(args[2]);
+  size_t x = Py::Int(args[1]);
+  size_t y = Py::Int(args[2]);
+
+  if (x > 1 << 15 || y > 1 << 15) {
+throw Py::ValueError("x and y must both be less than 32768");
+  }
+
   int isoutput = Py::Int(args[3]);
 
   if (PyObject_CheckReadBuffer(bufin) != 1)
@@ -1155,6 +1164,10 @@
   unsigned int cols = Py::Int(args[4]);
   Py::Tuple bounds = args[5];
 
+  if (rows > 1 << 15 || cols > 1 << 15) {
+throw Py::ValueError("rows and cols must both be less than 32768");
+  }
+
   if (bounds.length() !=4)
   throw Py::TypeError("Incorrect number of bounds (4 expected)");
   float x_min = Py::Float(bounds[0]);
@@ -1391,6 +1404,10 @@
 Py::Tuple bounds = args[5];
 Py::Object bgp = args[6];
 
+if (rows > 1 << 15 || cols > 1 << 15) {
+  throw Py::ValueError("rows and cols must both be less than 32768");
+}
+
 if (bounds.length() !=4)
 throw Py::TypeError("Incorrect number of bounds (4 expected)");
 double x_left = Py::Float(bounds[0]);


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

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5734] trunk/matplotlib/doc/devel/documenting_mpl. rst

2008-07-10 Thread dsdale
Revision: 5734
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5734&view=rev
Author:   dsdale
Date: 2008-07-10 11:59:18 -0700 (Thu, 10 Jul 2008)

Log Message:
---
minor cleanup in documentation guide

Modified Paths:
--
trunk/matplotlib/doc/devel/documenting_mpl.rst

Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===
--- trunk/matplotlib/doc/devel/documenting_mpl.rst  2008-07-10 18:12:50 UTC 
(rev 5733)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst  2008-07-10 18:59:18 UTC 
(rev 5734)
@@ -18,8 +18,9 @@
 
 .. _Sphinx: http://sphinx.pocoo.org/
 
-The documentation sources are found in the `doc/` directory in the trunk.
-To build the users guide in html format, cd into `doc/users_guide` and do::
+The documentation sources are found in the :file:`doc/` directory in the trunk.
+To build the users guide in html format, cd into :file:`doc/` and
+do::
 
   python make.py html
 
@@ -30,19 +31,20 @@
 you can also pass a ``latex`` flag to make.py to build a pdf, or pass no
 arguments to build everything.
 
-The output produced by Sphinx can be configured by editing the `conf.py`
-file located in the `doc/`.
+The output produced by Sphinx can be configured by editing the :file:`conf.py`
+file located in the :file:`doc/`.
 
 
 Organization of matplotlib's documentation
 ==
 
-The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
-`doc/api` and `doc/faq`. The main entry point is `doc/index.rst`, which pulls
-in the `index.rst` file for the users guide, developers guide, api reference,
-and faqs. The documentation suite is built as a single document in order to
-make the most effective use of cross referencing, we want to make navigating
-the Matplotlib documentation as easy as possible.
+The actual ReStructured Text files are kept in :file:`doc/users`,
+:file:`doc/devel`, :file:`doc/api` and :file:`doc/faq`. The main entry point is
+:file:`doc/index.rst`, which pulls in the :file:`index.rst` file for the users
+guide, developers guide, api reference, and faqs. The documentation suite is
+built as a single document in order to make the most effective use of cross
+referencing, we want to make navigating the Matplotlib documentation as easy as
+possible.
 
 Additional files can be added to the various guides by including their base
 file name (the .rst extension is not necessary) in the table of contents.


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

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins