diff --git a/lib/matplotlib/tests/baseline_images/test_path/semi_log_with_zero.png b/lib/matplotlib/tests/baseline_images/test_path/semi_log_with_zero.png new file mode 100644 index 000000000000..8edfb8a0a64b Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_path/semi_log_with_zero.png differ diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index c664d746865d..be16a8cd8b56 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -3473,18 +3473,21 @@ def test_pathological_hexbin(): fig.savefig(out) assert_equal(len(w), 0) + @cleanup def test_color_None(): # issue 3855 fig, ax = plt.subplots() - ax.plot([1,2], [1,2], color=None) + ax.plot([1, 2], [1, 2], color=None) plt.show() + @cleanup def test_numerical_hist_label(): fig, ax = plt.subplots() ax.hist([range(15)] * 5, label=range(5)) + if __name__ == '__main__': import nose import sys diff --git a/lib/matplotlib/tests/test_path.py b/lib/matplotlib/tests/test_path.py index 3d0c56bd5d43..b1e1f2307e16 100644 --- a/lib/matplotlib/tests/test_path.py +++ b/lib/matplotlib/tests/test_path.py @@ -72,6 +72,17 @@ def test_point_in_path_nan(): assert not contains[0] +@image_comparison(baseline_images=['semi_log_with_zero'], extensions=['png']) +def test_log_transform_with_zero(): + x = np.arange(-10, 10) + y = (1.0 - 1.0/(x**2+1))**20 + + fig, ax = plt.subplots() + ax.semilogy(x, y, "-o", lw=15) + ax.grid(True) + plt.show() + + if __name__ == '__main__': import nose nose.runmodule(argv=['-s', '--with-doctest'], exit=False) diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index 0c7a48cbf7c7..0a1d7f21ce69 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -1411,9 +1411,8 @@ def transform_path_non_affine(self, path): ``transform_path(path)`` is equivalent to ``transform_path_affine(transform_path_non_affine(values))``. """ - x = self.transform_non_affine(path.vertices) - return Path._fast_from_codes_and_verts(x, path.codes, - {'interpolation_steps': path._interpolation_steps}) + return Path(self.transform_non_affine(path.vertices), path.codes, + path._interpolation_steps) def transform_angles(self, angles, pts, radians=False, pushoff=1e-5): """ @@ -2619,8 +2618,8 @@ def _revalidate(self): self._transformed_path = \ self._transform.transform_path_non_affine(self._path) self._transformed_points = \ - Path._fast_from_codes_and_verts(self._transform.transform_non_affine(self._path.vertices), - None, {'interpolation_steps': self._path._interpolation_steps}) + Path(self._transform.transform_non_affine(self._path.vertices), + None, self._path._interpolation_steps) self._invalid = 0 def get_transformed_points_and_affine(self):