SF.net SVN: matplotlib: [4886] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/basemap.py
Revision: 4886 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4886&view=rev Author: jswhit Date: 2008-01-23 05:20:03 -0800 (Wed, 23 Jan 2008) Log Message: --- make a copy of projparams dict, so original is not modified. Modified Paths: -- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py === --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-01-22 19:43:18 UTC (rev 4885) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-01-23 13:20:03 UTC (rev 4886) @@ -930,7 +930,7 @@ boundaryxy = _geos.Polygon(b) # compute proj instance for full disk, if necessary. if not self._fulldisk: -projparms = self.projparams +projparms = self.projparams.copy() del projparms['x_0'] del projparms['y_0'] if self.projection == 'ortho': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4887] trunk/toolkits/basemap/examples
Revision: 4887 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4887&view=rev Author: jswhit Date: 2008-01-23 05:33:01 -0800 (Wed, 23 Jan 2008) Log Message: --- remove backwards compatibility kludge for ax.get_position Modified Paths: -- trunk/toolkits/basemap/examples/contour_demo.py trunk/toolkits/basemap/examples/panelplot.py trunk/toolkits/basemap/examples/plotmap.py trunk/toolkits/basemap/examples/plotmap_masked.py trunk/toolkits/basemap/examples/plotmap_oo.py trunk/toolkits/basemap/examples/plotprecip.py trunk/toolkits/basemap/examples/pnganim.py trunk/toolkits/basemap/examples/simpletest_oo.py trunk/toolkits/basemap/examples/test.py Modified: trunk/toolkits/basemap/examples/contour_demo.py === --- trunk/toolkits/basemap/examples/contour_demo.py 2008-01-23 13:20:03 UTC (rev 4886) +++ trunk/toolkits/basemap/examples/contour_demo.py 2008-01-23 13:33:01 UTC (rev 4887) @@ -22,11 +22,8 @@ CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) # setup colorbar axes instance. -# for matplotlib 0.91 and earlier, could do l,b,w,h = ax.get_position() -# for post 0.91, pos = ax.get_position(); l,b,w,h = pos.bounds -# this works for both. pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -52,7 +49,7 @@ CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -78,7 +75,7 @@ CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -104,7 +101,7 @@ CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -131,7 +128,7 @@ CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again Modified: trunk/toolkits/basemap/examples/panelplot.py === --- trunk/toolkits/basemap/examples/panelplot.py2008-01-23 13:20:03 UTC (rev 4886) +++ trunk/toolkits/basemap/examples/panelplot.py2008-01-23 13:33:01 UTC (rev 4887) @@ -28,7 +28,7 @@ CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.Spectral) # colorbar on bottom. pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes P.colorbar(cax=cax, orientation='horizontal',ticks=CS.levels[0::4]) # draw colorbar P.axes(ax) # make the original axes current again @@ -51,7 +51,7 @@ CS = msh.contourf(xsh,ysh,hgt,15,cmap=P.cm.Spectral) # colorbar on bottom. pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes P.colorbar(cax=cax,orientation='horizontal',ticks=MultipleLocator(320)) # draw colorbar P.axes(ax) # make the original axes current again @@ -74,7 +74,7 @@ CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.RdBu) # colorbar on right pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = P.axes([l+w+0.025, b, 0.025, h]) # setup colorbar axes P.colorbar(cax=cax, ticks=MultipleLocator(160), format='%4i') # draw colorbar P.axes(ax) # make the original axes current again @@ -89,7 +89,7 @@ CS = msh.contourf(xsh,ysh,hgt,15,cmap=P.cm.RdBu) # colorbar on right. pos = ax.get_position() -l, b, w, h = getattr(pos, 'bounds', pos) +l, b, w, h = pos.bounds cax = P.axes([l+w+0.025, b, 0.025, h]) # setup colorbar axes P.colorbar(cax=cax, ticks=MultipleLocator(160), format='%4i') # draw colorbar P.axes(ax) # make the original axes current again Modified: trunk/toolkits/basemap/examples/plotmap.py ==
SF.net SVN: matplotlib: [4888] trunk/matplotlib/src
Revision: 4888
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4888&view=rev
Author: mdboom
Date: 2008-01-23 06:35:21 -0800 (Wed, 23 Jan 2008)
Log Message:
---
Minor speed improvements in Agg backend.
Modified Paths:
--
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/agg_py_path_iterator.h
Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 13:33:01 UTC (rev
4887)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 14:35:21 UTC (rev
4888)
@@ -343,6 +343,10 @@
return false;
code = path.vertex(&x0, &y0);
+ if (code == agg::path_cmd_stop) {
+path.rewind(0);
+return false;
+ }
trans.transform(&x0, &y0);
while ((code = path.vertex(&x1, &y1)) != agg::path_cmd_stop) {
@@ -1602,7 +1606,6 @@
double g = Py::Float(rgb[1]);
double b = Py::Float(rgb[2]);
return agg::rgba(r, g, b, alpha);
-
}
@@ -1615,8 +1618,6 @@
double p = Py::Float( points ) ;
//return (int)(p*PIXELS_PER_INCH/72.0*dpi/72.0)+0.5;
return (int)(p*dpi/72.0)+0.5;
-
-
}
double
Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-23 13:33:01 UTC (rev
4887)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-23 14:35:21 UTC (rev
4888)
@@ -118,7 +118,7 @@
SimplifyPath(VertexSource& source, bool quantize, bool simplify,
double width = 0.0, double height = 0.0) :
m_source(&source), m_quantize(quantize), m_simplify(simplify),
-m_width(width), m_height(height), m_queue_read(0),
m_queue_write(0),
+m_width(width + 1.0), m_height(height + 1.0), m_queue_read(0),
m_queue_write(0),
m_moveto(true), m_lastx(0.0), m_lasty(0.0), m_clipped(false),
m_do_clipping(width > 0.0 && height > 0.0),
m_origdx(0.0), m_origdy(0.0),
@@ -246,9 +246,9 @@
//could be clipped, but a more involved calculation would be needed
if (m_do_clipping &&
((*x < -1.0 && m_lastx < -1.0) ||
- (*x > m_width + 1.0 && m_lastx > m_width + 1.0) ||
+ (*x > m_width && m_lastx > m_width) ||
(*y < -1.0 && m_lasty < -1.0) ||
- (*y > m_height + 1.0 && m_lasty > m_height + 1.0)))
+ (*y > m_height && m_lasty > m_height)))
{
m_lastx = *x;
m_lasty = *y;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4889] trunk/matplotlib/src/_backend_agg.cpp
Revision: 4889
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4889&view=rev
Author: mdboom
Date: 2008-01-23 10:13:40 -0800 (Wed, 23 Jan 2008)
Log Message:
---
Remove an accidental printf.
Modified Paths:
--
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 14:35:21 UTC (rev
4888)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 18:13:40 UTC (rev
4889)
@@ -929,7 +929,8 @@
PyArrayObject* edgecolors = NULL;
try {
-offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj.ptr(),
PyArray_DOUBLE, 0, 2);
+offsets = (PyArrayObject*)PyArray_FromObject
+ (offsets_obj.ptr(), PyArray_DOUBLE, 0, 2);
if (!offsets ||
(PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) ||
(PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) {
@@ -1078,7 +1079,6 @@
Py_XDECREF(edgecolors);
return Py::Object();
} catch (...) {
-printf("Exception!\n");
Py_XDECREF(offsets);
Py_XDECREF(facecolors);
Py_XDECREF(edgecolors);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4890] trunk/matplotlib/lib/matplotlib/axes.py
Revision: 4890 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4890&view=rev Author: mdboom Date: 2008-01-23 10:27:05 -0800 (Wed, 23 Jan 2008) Log Message: --- Fix relim again (thanks Darren Dale) Modified Paths: -- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py === --- trunk/matplotlib/lib/matplotlib/axes.py 2008-01-23 18:13:40 UTC (rev 4889) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-01-23 18:27:05 UTC (rev 4890) @@ -1200,12 +1200,11 @@ def relim(self): 'recompute the datalimits based on current artists' self.dataLim.ignore(True) +self.ignore_existing_data_limits = True for line in self.lines: -self.ignore_existing_data_limits = True self._update_line_limits(line) for p in self.patches: -self.ignore_existing_data_limits = True self._update_patch_limits(p) def update_datalim(self, xys): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4891] trunk/matplotlib/src
Revision: 4891 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4891&view=rev Author: mdboom Date: 2008-01-23 11:12:41 -0800 (Wed, 23 Jan 2008) Log Message: --- Fix warnings on gcc 4.2.1 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-01-23 18:27:05 UTC (rev 4890) +++ trunk/matplotlib/src/_backend_agg.cpp 2008-01-23 19:12:41 UTC (rev 4891) @@ -1300,7 +1300,7 @@ PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write"); PyObject* result = NULL; if (write_method) -result = PyObject_CallFunction(write_method, "s#", data, length); +result = PyObject_CallFunction(write_method, (char *)"s#", data, length); Py_XDECREF(write_method); Py_XDECREF(result); } @@ -1310,7 +1310,7 @@ PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "flush"); PyObject* result = NULL; if (flush_method) -result = PyObject_CallFunction(flush_method, ""); +result = PyObject_CallFunction(flush_method, (char *)""); Py_XDECREF(flush_method); Py_XDECREF(result); } Modified: trunk/matplotlib/src/_image.cpp === --- trunk/matplotlib/src/_image.cpp 2008-01-23 18:27:05 UTC (rev 4890) +++ trunk/matplotlib/src/_image.cpp 2008-01-23 19:12:41 UTC (rev 4891) @@ -580,7 +580,7 @@ PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write"); PyObject* result = NULL; if (write_method) -result = PyObject_CallFunction(write_method, "s#", data, length); +result = PyObject_CallFunction(write_method, (char *)"s#", data, length); Py_XDECREF(write_method); Py_XDECREF(result); } @@ -590,7 +590,7 @@ PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "flush"); PyObject* result = NULL; if (flush_method) -result = PyObject_CallFunction(flush_method, ""); +result = PyObject_CallFunction(flush_method, (char *)""); Py_XDECREF(flush_method); Py_XDECREF(result); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4892] trunk/matplotlib/lib/matplotlib/path.py
Revision: 4892 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4892&view=rev Author: mdboom Date: 2008-01-23 12:33:27 -0800 (Wed, 23 Jan 2008) Log Message: --- Fix exception with maskedarray branch of numpy (Thanks, David Huard) Modified Paths: -- trunk/matplotlib/lib/matplotlib/path.py Modified: trunk/matplotlib/lib/matplotlib/path.py === --- trunk/matplotlib/lib/matplotlib/path.py 2008-01-23 19:12:41 UTC (rev 4891) +++ trunk/matplotlib/lib/matplotlib/path.py 2008-01-23 20:33:27 UTC (rev 4892) @@ -117,7 +117,7 @@ codes = self.LINETO * npy.ones( len(vertices), self.code_type) codes[0] = self.MOVETO -vertices = ma.compress(npy.invert(mask1d), vertices, 0) +vertices = npy.compress(npy.invert(mask1d), vertices, 0) vertices = npy.asarray(vertices) codes = npy.where(npy.concatenate((mask1d[-1:], mask1d[:-1])), self.MOVETO, codes) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4893] trunk/matplotlib/lib/matplotlib/path.py
Revision: 4893 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4893&view=rev Author: efiring Date: 2008-01-23 14:35:10 -0800 (Wed, 23 Jan 2008) Log Message: --- streamline handling of masked values in Path.__init__ Modified Paths: -- trunk/matplotlib/lib/matplotlib/path.py Modified: trunk/matplotlib/lib/matplotlib/path.py === --- trunk/matplotlib/lib/matplotlib/path.py 2008-01-23 20:33:27 UTC (rev 4892) +++ trunk/matplotlib/lib/matplotlib/path.py 2008-01-23 22:35:10 UTC (rev 4893) @@ -101,7 +101,7 @@ mask = ma.nomask if codes is not None: - codes = npy.asarray(codes, self.code_type) +codes = npy.asarray(codes, self.code_type) assert codes.ndim == 1 assert len(codes) == len(vertices) @@ -112,17 +112,15 @@ # MOVETO commands to the codes array accordingly. if is_mask: if mask is not ma.nomask: -mask1d = ma.mask_or(mask[:, 0], mask[:, 1]) +mask1d = npy.logical_or.reduce(mask, axis=1) +gmask1d = npy.invert(mask1d) if codes is None: -codes = self.LINETO * npy.ones( -len(vertices), self.code_type) +codes = npy.empty((len(vertices)), self.code_type) +codes.fill(self.LINETO) codes[0] = self.MOVETO -vertices = npy.compress(npy.invert(mask1d), vertices, 0) -vertices = npy.asarray(vertices) -codes = npy.where(npy.concatenate((mask1d[-1:], mask1d[:-1])), - self.MOVETO, codes) -codes = ma.masked_array(codes, mask=mask1d).compressed() -codes = npy.asarray(codes, self.code_type) +vertices = vertices[gmask1d].filled() # ndarray +codes[npy.roll(mask1d, 1)] = self.MOVETO +codes = codes[gmask1d] # npy.compress is much slower else: vertices = npy.asarray(vertices, npy.float_) @@ -130,7 +128,7 @@ assert vertices.shape[1] == 2 self.codes = codes - self.vertices = vertices +self.vertices = vertices [EMAIL PROTECTED] def make_compound_path(*args): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
