From 73f1ed43156937cc86133fa5eaf8b1279b3d27a8 Mon Sep 17 00:00:00 2001 From: sindunuragarp Date: Mon, 13 Mar 2017 20:23:58 +0100 Subject: [PATCH 1/5] refactored duplication in vline hline --- lib/matplotlib/markers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index 366a17e4fceb..175cb198636c 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -694,10 +694,8 @@ def _set_vline(self): self._path = self._line_marker_path def _set_hline(self): - self._transform = Affine2D().scale(0.5).rotate_deg(90) - self._snap_threshold = 1.0 - self._filled = False - self._path = self._line_marker_path + self._set_vline() + self._transform = self._transform.rotate_deg(90) _tickhoriz_path = Path([[0.0, 0.0], [1.0, 0.0]]) From 34d014f6023dce0a3a86e94d21ecef35fbc277e2 Mon Sep 17 00:00:00 2001 From: sindunuragarp Date: Mon, 13 Mar 2017 20:24:44 +0100 Subject: [PATCH 2/5] Moved plus function closer to similar x function --- lib/matplotlib/markers.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index 175cb198636c..05b44aa82606 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -725,17 +725,6 @@ def _set_tickdown(self): self._filled = False self._path = self._tickvert_path - _plus_path = Path([[-1.0, 0.0], [1.0, 0.0], - [0.0, -1.0], [0.0, 1.0]], - [Path.MOVETO, Path.LINETO, - Path.MOVETO, Path.LINETO]) - - def _set_plus(self): - self._transform = Affine2D().scale(0.5) - self._snap_threshold = 1.0 - self._filled = False - self._path = self._plus_path - _tri_path = Path([[0.0, 0.0], [0.0, -1.0], [0.0, 0.0], [0.8, 0.5], [0.0, 0.0], [-0.8, 0.5]], @@ -827,6 +816,17 @@ def _set_caretrightbase(self): self._path = self._caret_path_base self._joinstyle = 'miter' + _plus_path = Path([[-1.0, 0.0], [1.0, 0.0], + [0.0, -1.0], [0.0, 1.0]], + [Path.MOVETO, Path.LINETO, + Path.MOVETO, Path.LINETO]) + + def _set_plus(self): + self._transform = Affine2D().scale(0.5) + self._snap_threshold = 1.0 + self._filled = False + self._path = self._plus_path + _x_path = Path([[-1.0, -1.0], [1.0, 1.0], [-1.0, 1.0], [1.0, -1.0]], [Path.MOVETO, Path.LINETO, From acb7061982062ef9574112501724a043ec376ca7 Mon Sep 17 00:00:00 2001 From: sindunuragarp Date: Mon, 13 Mar 2017 20:38:12 +0100 Subject: [PATCH 3/5] Refactored repeated code in _set_tri_xxx functions --- lib/matplotlib/markers.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index 05b44aa82606..5aeea680b36c 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -739,22 +739,16 @@ def _set_tri_down(self): self._path = self._tri_path def _set_tri_up(self): - self._transform = Affine2D().scale(0.5).rotate_deg(180) - self._snap_threshold = 5.0 - self._filled = False - self._path = self._tri_path + self._set_tri_down() + self._transform = self._transform.rotate_deg(180) def _set_tri_left(self): - self._transform = Affine2D().scale(0.5).rotate_deg(270) - self._snap_threshold = 5.0 - self._filled = False - self._path = self._tri_path + self._set_tri_down() + self._transform = self._transform.rotate_deg(270) def _set_tri_right(self): - self._transform = Affine2D().scale(0.5).rotate_deg(90) - self._snap_threshold = 5.0 - self._filled = False - self._path = self._tri_path + self._set_tri_down() + self._transform = self._transform.rotate_deg(90) _caret_path = Path([[-1.0, 1.5], [0.0, 0.0], [1.0, 1.5]]) From 8f86eb62846828e0329ff3a4a2b0adb3a635438e Mon Sep 17 00:00:00 2001 From: sindunuragarp Date: Mon, 13 Mar 2017 20:49:48 +0100 Subject: [PATCH 4/5] Refactored repeated code in _set_caretxxx functions --- determinism_tex.svg | 29 ++++++++++++++++++++++++ lib/matplotlib/markers.py | 47 +++++++++++---------------------------- 2 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 determinism_tex.svg diff --git a/determinism_tex.svg b/determinism_tex.svg new file mode 100644 index 000000000000..8e22d6246e9b --- /dev/null +++ b/determinism_tex.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + Date: Sun, 19 Mar 2017 16:12:59 +0100 Subject: [PATCH 5/5] Removed unnecessary file --- determinism_tex.svg | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 determinism_tex.svg diff --git a/determinism_tex.svg b/determinism_tex.svg deleted file mode 100644 index 8e22d6246e9b..000000000000 --- a/determinism_tex.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - -