Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
Changes as a result of reading diffs prior to pull request.
  • Loading branch information
Phil Elson authored and pelson committed Aug 20, 2012
commit 83ed6c8a218c4e4b949af08b1c0a5f727fc17cc4
4 changes: 2 additions & 2 deletions lib/matplotlib/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,8 @@ def _update_line_limits(self, line):
return

line_trans = line.get_transform()

if line.get_transform() == self.transData:
if line_trans == self.transData:
data_path = path

elif line_trans.contains_branch(self.transData):
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import matplotlib
from matplotlib.testing.decorators import image_comparison, knownfailureif
import matplotlib.pyplot as plt
import matplotlib.transforms as mtrans


@image_comparison(baseline_images=['formatter_ticker_001',
Expand Down
26 changes: 8 additions & 18 deletions lib/matplotlib/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,9 @@ def _iter_break_from_left_to_right(self):
right recursively. If self == ((A, N), A) then the result will be an
iterator which yields I : ((A, N), A), followed by A : (N, A),
followed by (A, N) : (A), but not ((A, N), A) : I.
This is equivalent to flattening the stack then slicing it with
``flat_stack[i:]`` where i starts at 0 and ends at -1.

This is equivalent to flattening the stack then yielding
``flat_stack[:i], flat_stack[i:]`` where i=0..(n-1).

"""
yield IdentityTransform(), self
Expand Down Expand Up @@ -1136,11 +1137,12 @@ def __sub__(self, other):

# sometimes, when A contains the tree B there is no need to descend all the way down
# to the base of A (via B), instead we can just stop at B.
(A, B) - (B)-1 == A

(A + B) - (B)^-1 == A

# similarly, when B contains tree A, we can avoid decending A at all, basically:
A - B == (B - A).inverted() or B-1

A - (A + B) == ((B + A) - A).inverted() or B^-1
For clarity, the result of ``(A + B) - B + B == (A + B)``.

"""
Expand Down Expand Up @@ -1171,11 +1173,7 @@ def __array__(self, *args, **kwargs):
"""
Array interface to get at this Transform's matrix.
"""
# note, this method is also used by C/C++ -based backends
if self.is_affine:
return self.get_matrix()
else:
raise ValueError('Cannot convert this transform to an array.')
raise NotImplementedError()

def transform(self, values):
"""
Expand Down Expand Up @@ -1870,10 +1868,6 @@ def __repr__(self):
return "BlendedGenericTransform(%s,%s)" % (self._x, self._y)
__str__ = __repr__

def transform_affine(self, points):
return self.get_affine().transform(points)
transform_affine.__doc__ = Transform.transform_affine.__doc__

def transform_non_affine(self, points):
if self._x.is_affine and self._y.is_affine:
return points
Expand Down Expand Up @@ -2092,10 +2086,6 @@ def transform_non_affine(self, points):
self._a.transform(points))
transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__

def transform_path_affine(self, path):
return self.get_affine().transform_path_affine(path)
transform_path_affine.__doc__ = Transform.transform_path_affine.__doc__

def transform_path_non_affine(self, path):
if self._a.is_affine and self._b.is_affine:
return path
Expand Down