|
From: <ry...@us...> - 2008-07-23 02:44:50
|
Revision: 5818
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5818&view=rev
Author: ryanmay
Date: 2008-07-23 02:44:49 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Fix bug (typo) in Transform.transform_non_affine.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-07-23 01:18:27 UTC (rev 5817)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-07-23 02:44:49 UTC (rev 5818)
@@ -1052,7 +1052,7 @@
Accepts a numpy array of shape (N x :attr:`input_dims`) and
returns a numpy array of shape (N x :attr:`output_dims`).
"""
- return self.transform(points)
+ return self.transform(values)
def get_affine(self):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-08-06 20:39:44
|
Revision: 5982
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5982&view=rev
Author: efiring
Date: 2008-08-06 20:39:42 +0000 (Wed, 06 Aug 2008)
Log Message:
-----------
bugfix: masked array was created but not used
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-08-06 18:06:21 UTC (rev 5981)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-08-06 20:39:42 UTC (rev 5982)
@@ -808,7 +808,7 @@
return
points, minpos, changed = update_path_extents(
- Path(xy), None, self._points, self._minpos, ignore)
+ Path(xym), None, self._points, self._minpos, ignore)
if changed:
self._points = points
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-09-10 15:49:34
|
Revision: 6079
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6079&view=rev
Author: mdboom
Date: 2008-09-10 15:28:55 +0000 (Wed, 10 Sep 2008)
Log Message:
-----------
Fix numpy namespace (thanks Evan Mason)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-09-10 12:33:33 UTC (rev 6078)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-09-10 15:28:55 UTC (rev 6079)
@@ -599,7 +599,7 @@
dx1 = np.sign(vertices[:, 0] - x1)
dy1 = np.sign(vertices[:, 1] - y1)
inside = (abs(dx0 + dx1) + abs(dy0 + dy1)) <= 2
- return N.sum(inside)
+ return np.sum(inside)
def count_overlaps(self, bboxes):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-10-16 21:22:04
|
Revision: 6232
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6232&view=rev
Author: efiring
Date: 2008-10-16 21:21:58 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
Make transforms.nonsingular handle inf and nan sensibly.
Without this, trying to plot a line with all data masked would
raise an exception via the autoscaling.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-10-16 20:58:07 UTC (rev 6231)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-10-16 21:21:58 UTC (rev 6232)
@@ -2157,7 +2157,7 @@
def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True):
'''
- Ensure the endpoints of a range are not too close together.
+ Ensure the endpoints of a range are finite and not too close together.
"too close" means the interval is smaller than 'tiny' times
the maximum absolute value.
@@ -2165,7 +2165,11 @@
If they are too close, each will be moved by the 'expander'.
If 'increasing' is True and vmin > vmax, they will be swapped,
regardless of whether they are too close.
+
+ If either is inf or -inf or nan, return - expander, expander.
'''
+ if (not np.isfinite(vmin)) or (not np.isfinite(vmax)):
+ return -expander, expander
swapped = False
if vmax < vmin:
vmin, vmax = vmax, vmin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dmk...@us...> - 2008-11-05 14:02:13
|
Revision: 6362
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6362&view=rev
Author: dmkaplan
Date: 2008-11-05 14:02:07 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
Added a method to class Transforms in transform.py that transforms
angles. The generic method uses a generic algorithm involving pushing
off from a group of locations to determine new angles. This should
work with almost any transform, but much quicker algorithms can be
found for affine transforms. These algorithms have not yet been added
though, so the generic method will be used until they are.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-11-04 13:38:15 UTC (rev 6361)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-11-05 14:02:07 UTC (rev 6362)
@@ -1131,6 +1131,63 @@
"""
return Path(self.transform_non_affine(path.vertices), path.codes)
+ def transform_angles(self, angles, pts, radians=False, pushoff=1e-5):
+ """
+ Performs transformation on a set of angles anchored at
+ specific locations.
+
+ The *angles* must be a column vector (i.e., numpy array).
+
+ The *pts* must be a two-column numpy array of x,y positions
+ (angle transforms currently only work in 2D). This array must
+ have the same number of rows as *angles*.
+
+ *radians* indicates whether or not input angles are given in
+ radians (True) or degrees (False; the default).
+
+ *pushoff* is the distance to move away from *pts* for
+ determining transformed angles (see discussion of method
+ below).
+
+ The transformed angles are returned in an array with the same
+ size as *angles*.
+
+ The generic version of this method uses a very generic
+ algorithm that transforms *pts*, as well as locations very
+ close to *pts*, to find the angle in the transformed system.
+ """
+ # Must be 2D
+ if self.input_dims <> 2 or self.output_dims <> 2:
+ raise NotImplementedError('Only defined in 2D')
+
+ # pts must be array with 2 columns for x,y
+ assert pts.shape[1] == 2
+
+ # angles must be a column vector and have same number of
+ # rows as pts
+ assert np.prod(angles.shape) == angles.shape[0] == pts.shape[0]
+
+ # Convert to radians if desired
+ if not radians:
+ angles = angles / 180.0 * np.pi
+
+ # Move a short distance away
+ pts2 = pts + pushoff * np.c_[ np.cos(angles), np.sin(angles) ]
+
+ # Transform both sets of points
+ tpts = self.transform( pts )
+ tpts2 = self.transform( pts2 )
+
+ # Calculate transformed angles
+ d = tpts2 - tpts
+ a = np.arctan2( d[:,1], d[:,0] )
+
+ # Convert back to degrees if desired
+ if not radians:
+ a = a * 180.0 / np.pi
+
+ return a
+
def inverted(self):
"""
Return the corresponding inverse transformation.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-01 19:35:43
|
Revision: 6465
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6465&view=rev
Author: mdboom
Date: 2008-12-01 19:35:39 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Non-affine transformation invalidation wasn't propagating correctly.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-01 19:07:08 UTC (rev 6464)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-01 19:35:39 UTC (rev 6465)
@@ -115,12 +115,12 @@
return
# Invalidate all ancestors of self using pseudo-recursion.
- parent = None
stack = [self]
while len(stack):
root = stack.pop()
# Stop at subtrees that have already been invalidated
if root._invalid != value or root.pass_through:
+ value |= root._invalid
root._invalid = value
stack.extend(root._parents.keys())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-02 15:52:42
|
Revision: 6469
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6469&view=rev
Author: mdboom
Date: 2008-12-02 15:52:39 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
Minor formatting changes.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-02 15:40:44 UTC (rev 6468)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-02 15:52:39 UTC (rev 6469)
@@ -313,7 +313,8 @@
return [min(self.get_points()[:, 0]),
min(self.get_points()[:, 1])]
min = property(_get_min, None, None, """
- (property) :attr:`min` is the bottom-left corner of the bounding box.""")
+ (property) :attr:`min` is the bottom-left corner of the bounding
+ box.""")
def _get_max(self):
return [max(self.get_points()[:, 0]),
@@ -324,41 +325,44 @@
def _get_intervalx(self):
return self.get_points()[:, 0]
intervalx = property(_get_intervalx, None, None, """
- (property) :attr:`intervalx` is the pair of *x* coordinates that define the
- bounding box. It is not guaranteed to be sorted from left to right.""")
+ (property) :attr:`intervalx` is the pair of *x* coordinates that define
+ the bounding box. It is not guaranteed to be sorted from left to
+ right.""")
def _get_intervaly(self):
return self.get_points()[:, 1]
intervaly = property(_get_intervaly, None, None, """
- (property) :attr:`intervaly` is the pair of *y* coordinates that define the
- bounding box. It is not guaranteed to be sorted from bottom to top.""")
+ (property) :attr:`intervaly` is the pair of *y* coordinates that define
+ the bounding box. It is not guaranteed to be sorted from bottom to
+ top.""")
def _get_width(self):
points = self.get_points()
return points[1, 0] - points[0, 0]
width = property(_get_width, None, None, """
- (property) The width of the bounding box. It may be negative if :attr:`x1` <
- :attr:`x0`.""")
+ (property) The width of the bounding box. It may be negative if
+ :attr:`x1` < :attr:`x0`.""")
def _get_height(self):
points = self.get_points()
return points[1, 1] - points[0, 1]
height = property(_get_height, None, None, """
- (property) The height of the bounding box. It may be negative if :attr:`y1` <
- :attr:`y0`.""")
+ (property) The height of the bounding box. It may be negative if
+ :attr:`y1` < :attr:`y0`.""")
def _get_size(self):
points = self.get_points()
return points[1] - points[0]
size = property(_get_size, None, None, """
- (property) The width and height of the bounding box. May be negative, in the same
- way as :attr:`width` and :attr:`height`.""")
+ (property) The width and height of the bounding box. May be negative,
+ in the same way as :attr:`width` and :attr:`height`.""")
def _get_bounds(self):
x0, y0, x1, y1 = self.get_points().flatten()
return (x0, y0, x1 - x0, y1 - y0)
bounds = property(_get_bounds, None, None, """
- (property) Returns (:attr:`x0`, :attr:`y0`, :attr:`width`, :attr:`height`).""")
+ (property) Returns (:attr:`x0`, :attr:`y0`, :attr:`width`,
+ :attr:`height`).""")
def _get_extents(self):
return self.get_points().flatten().copy()
@@ -788,7 +792,8 @@
- when False, include the existing bounds of the :class:`Bbox`.
- when None, use the last value passed to :meth:`ignore`.
"""
- warnings.warn("update_from_data requires a memory copy -- please replace with update_from_data_xy")
+ warnings.warn(
+ "update_from_data requires a memory copy -- please replace with update_from_data_xy")
xy = np.hstack((x.reshape((len(x), 1)), y.reshape((len(y), 1))))
return self.update_from_data_xy(xy, ignore)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-02 17:54:50
|
Revision: 6473
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6473&view=rev
Author: mdboom
Date: 2008-12-02 17:54:44 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
Fix axhline etc. with non-linear scales.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-02 17:53:45 UTC (rev 6472)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-12-02 17:54:44 UTC (rev 6473)
@@ -1237,6 +1237,7 @@
of the same dimensions.
"""
pass_through = True
+ is_affine = False
def __init__(self, child):
"""
@@ -1288,10 +1289,6 @@
self.invalidate()
self._invalid = 0
- def _get_is_affine(self):
- return self._child.is_affine
- is_affine = property(_get_is_affine)
-
def _get_is_separable(self):
return self._child.is_separable
is_separable = property(_get_is_separable)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-05-22 17:50:41
|
Revision: 7135
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7135&view=rev
Author: efiring
Date: 2009-05-22 17:50:32 +0000 (Fri, 22 May 2009)
Log Message:
-----------
Fix typo in r7131
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2009-05-22 17:36:28 UTC (rev 7134)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2009-05-22 17:50:32 UTC (rev 7135)
@@ -1145,7 +1145,7 @@
``transform_path_affine(transform_path_non_affine(values))``.
"""
return Path(self.transform_non_affine(path.vertices), path.codes,
- self._interpolation_steps)
+ path._interpolation_steps)
def transform_angles(self, angles, pts, radians=False, pushoff=1e-5):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-10-06 15:47:27
|
Revision: 7854
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7854&view=rev
Author: astraw
Date: 2009-10-06 15:47:13 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
trivial: delete trailing whitespace from source code lines
(This is really an excuse to make an SVN commit to trigger the buildbot.)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2009-10-06 15:42:19 UTC (rev 7853)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2009-10-06 15:47:13 UTC (rev 7854)
@@ -956,8 +956,8 @@
self._points[1,1]!=self._points_orig[1,1])
-
+
class TransformedBbox(BboxBase):
"""
A :class:`Bbox` that is automatically transformed by a given
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-02-26 16:28:02
|
Revision: 8161
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8161&view=rev
Author: mdboom
Date: 2010-02-26 16:27:55 +0000 (Fri, 26 Feb 2010)
Log Message:
-----------
Fix offset_copy: the fig argument should be optional.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2010-02-26 16:27:22 UTC (rev 8160)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2010-02-26 16:27:55 UTC (rev 8161)
@@ -2284,7 +2284,7 @@
((a < b) and (a < val and b > val))
or (b < val and a > val))
-def offset_copy(trans, fig, x=0.0, y=0.0, units='inches'):
+def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
'''
Return a new transform with an added offset.
args:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|