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

Skip to content

Commit 4b27deb

Browse files
committed
Fix polygon closing on triangle markers (Bug #3102034)
svn path=/branches/v1_0_maint/; revision=8824
1 parent 6de9019 commit 4b27deb

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

lib/matplotlib/lines.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,11 @@ def set_marker(self, marker):
797797
798798
799799
800-
ACCEPTS: [ ``'+'`` | ``'*'`` | ``','`` | ``'.'``
800+
ACCEPTS: [ ``'+'`` | ``'*'`` | ``','`` | ``'.'``
801801
| ``'1'`` | ``'2'`` | ``'3'`` | ``'4'``
802-
| ``'<'`` | ``'>'`` | ``'D'`` | ``'H'``
803-
| ``'^'`` | ``'_'`` | ``'d'`` | ``'h'``
804-
| ``'o'`` | ``'p'`` | ``'s'`` | ``'v'``
802+
| ``'<'`` | ``'>'`` | ``'D'`` | ``'H'``
803+
| ``'^'`` | ``'_'`` | ``'d'`` | ``'h'``
804+
| ``'o'`` | ``'p'`` | ``'s'`` | ``'v'``
805805
| ``'x'`` | ``'|'``
806806
| TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT
807807
| CARETUP | CARETDOWN | CARETLEFT | CARETRIGHT
@@ -1069,12 +1069,17 @@ def _draw_circle(self, renderer, gc, path, path_trans):
10691069
path, path_trans, rgbFace_alt)
10701070

10711071

1072-
_triangle_path = Path([[0.0, 1.0], [-1.0, -1.0], [1.0, -1.0], [0.0, 1.0]])
1072+
_triangle_path = Path([[0.0, 1.0], [-1.0, -1.0], [1.0, -1.0], [0.0, 1.0]],
1073+
[Path.MOVETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY])
10731074
# Going down halfway looks to small. Golden ratio is too far.
1074-
_triangle_path_u = Path([[0.0, 1.0], [-3/5., -1/5.], [3/5., -1/5.], [0.0, 1.0]])
1075-
_triangle_path_d = Path([[-3/5., -1/5.], [3/5., -1/5.], [1.0, -1.0], [-1.0, -1.0], [-3/5., -1/5.]])
1076-
_triangle_path_l = Path([[0.0, 1.0], [0.0, -1.0], [-1.0, -1.0], [0.0, 1.0]])
1077-
_triangle_path_r = Path([[0.0, 1.0], [0.0, -1.0], [1.0, -1.0], [0.0, 1.0]])
1075+
_triangle_path_u = Path([[0.0, 1.0], [-3/5., -1/5.], [3/5., -1/5.], [0.0, 1.0]],
1076+
[Path.MOVETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY])
1077+
_triangle_path_d = Path([[-3/5., -1/5.], [3/5., -1/5.], [1.0, -1.0], [-1.0, -1.0], [-3/5., -1/5.]],
1078+
[Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY])
1079+
_triangle_path_l = Path([[0.0, 1.0], [0.0, -1.0], [-1.0, -1.0], [0.0, 1.0]],
1080+
[Path.MOVETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY])
1081+
_triangle_path_r = Path([[0.0, 1.0], [0.0, -1.0], [1.0, -1.0], [0.0, 1.0]],
1082+
[Path.MOVETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY])
10781083
def _draw_triangle(self, renderer, gc, path, path_trans, direction):
10791084
gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0)
10801085
offset = 0.5*renderer.points_to_pixels(self._markersize)

0 commit comments

Comments
 (0)