3131"d" thin_diamond
3232"|" vline
3333"_" hline
34+ "P" plus (filled)
35+ "X" x (filled)
3436TICKLEFT tickleft
3537TICKRIGHT tickright
3638TICKUP tickup
@@ -126,6 +128,8 @@ class MarkerStyle(object):
126128 'd' : 'thin_diamond' ,
127129 '|' : 'vline' ,
128130 '_' : 'hline' ,
131+ 'P' : 'plus_filled' ,
132+ 'X' : 'x_filled' ,
129133 TICKLEFT : 'tickleft' ,
130134 TICKRIGHT : 'tickright' ,
131135 TICKUP : 'tickup' ,
@@ -147,7 +151,8 @@ class MarkerStyle(object):
147151 # Just used for informational purposes. is_filled()
148152 # is calculated in the _set_* functions.
149153 filled_markers = (
150- 'o' , 'v' , '^' , '<' , '>' , '8' , 's' , 'p' , '*' , 'h' , 'H' , 'D' , 'd' )
154+ 'o' , 'v' , '^' , '<' , '>' , '8' , 's' , 'p' , '*' , 'h' , 'H' , 'D' , 'd' ,
155+ 'P' , 'X' )
151156
152157 fillstyles = ('full' , 'left' , 'right' , 'bottom' , 'top' , 'none' )
153158 _half_fillstyles = ('left' , 'right' , 'bottom' , 'top' )
@@ -818,13 +823,92 @@ def _set_caretrightbase(self):
818823 self ._path = self ._caret_path_base
819824 self ._joinstyle = 'miter'
820825
821- _x_path = Path ([[- 1.0 , - 1.0 ], [1.0 , 1.0 ],
822- [- 1.0 , 1.0 ], [1.0 , - 1.0 ]],
823- [Path .MOVETO , Path .LINETO ,
824- Path .MOVETO , Path .LINETO ])
825-
826826 def _set_x (self ):
827827 self ._transform = Affine2D ().scale (0.5 )
828828 self ._snap_threshold = 3.0
829829 self ._filled = False
830830 self ._path = self ._x_path
831+
832+ _plus_filled_path = Path ([(1 / 3 , 0 ), (2 / 3 , 0 ), (2 / 3 , 1 / 3 ),
833+ (1 , 1 / 3 ), (1 , 2 / 3 ), (2 / 3 , 2 / 3 ),
834+ (2 / 3 , 1 ), (1 / 3 , 1 ), (1 / 3 , 2 / 3 ),
835+ (0 , 2 / 3 ), (0 , 1 / 3 ), (1 / 3 , 1 / 3 ),
836+ (1 / 3 , 0 )],
837+ [Path .MOVETO , Path .LINETO , Path .LINETO ,
838+ Path .LINETO , Path .LINETO , Path .LINETO ,
839+ Path .LINETO , Path .LINETO , Path .LINETO ,
840+ Path .LINETO , Path .LINETO , Path .LINETO ,
841+ Path .CLOSEPOLY ])
842+
843+ _plus_filled_path_t = Path ([(1 , 1 / 2 ), (1 , 2 / 3 ), (2 / 3 , 2 / 3 ),
844+ (2 / 3 , 1 ), (1 / 3 , 1 ), (1 / 3 , 2 / 3 ),
845+ (0 , 2 / 3 ), (0 , 1 / 2 ), (1 , 1 / 2 )],
846+ [Path .MOVETO , Path .LINETO , Path .LINETO ,
847+ Path .LINETO , Path .LINETO , Path .LINETO ,
848+ Path .LINETO , Path .LINETO ,
849+ Path .CLOSEPOLY ])
850+
851+ def _set_plus_filled (self ):
852+ self ._transform = Affine2D ().translate (- 0.5 , - 0.5 )
853+ self ._snap_threshold = 5.0
854+ self ._joinstyle = 'miter'
855+ fs = self .get_fillstyle ()
856+ if not self ._half_fill ():
857+ self ._path = self ._plus_filled_path
858+ else :
859+ # Rotate top half path to support all partitions
860+ if fs == 'top' :
861+ rotate , rotate_alt = 0 , 180
862+ elif fs == 'bottom' :
863+ rotate , rotate_alt = 180 , 0
864+ elif fs == 'left' :
865+ rotate , rotate_alt = 90 , 270
866+ else :
867+ rotate , rotate_alt = 270 , 90
868+
869+ self ._path = self ._plus_filled_path_t
870+ self ._alt_path = self ._plus_filled_path_t
871+ self ._alt_transform = Affine2D ().translate (- 0.5 , - 0.5 )
872+ self ._transform .rotate_deg (rotate )
873+ self ._alt_transform .rotate_deg (rotate_alt )
874+
875+ _x_filled_path = Path ([(0.25 , 0 ), (0.5 , 0.25 ), (0.75 , 0 ), (1 , 0.25 ),
876+ (0.75 , 0.5 ), (1 , 0.75 ), (0.75 , 1 ), (0.5 , 0.75 ),
877+ (0.25 , 1 ), (0 , 0.75 ), (0.25 , 0.5 ), (0 , 0.25 ),
878+ (0.25 , 0 )],
879+ [Path .MOVETO , Path .LINETO , Path .LINETO ,
880+ Path .LINETO , Path .LINETO , Path .LINETO ,
881+ Path .LINETO , Path .LINETO , Path .LINETO ,
882+ Path .LINETO , Path .LINETO , Path .LINETO ,
883+ Path .CLOSEPOLY ])
884+
885+ _x_filled_path_t = Path ([(0.75 , 0.5 ), (1 , 0.75 ), (0.75 , 1 ),
886+ (0.5 , 0.75 ), (0.25 , 1 ), (0 , 0.75 ),
887+ (0.25 , 0.5 ), (0.75 , 0.5 )],
888+ [Path .MOVETO , Path .LINETO , Path .LINETO ,
889+ Path .LINETO , Path .LINETO , Path .LINETO ,
890+ Path .LINETO , Path .CLOSEPOLY ])
891+
892+ def _set_x_filled (self ):
893+ self ._transform = Affine2D ().translate (- 0.5 , - 0.5 )
894+ self ._snap_threshold = 5.0
895+ self ._joinstyle = 'miter'
896+ fs = self .get_fillstyle ()
897+ if not self ._half_fill ():
898+ self ._path = self ._x_filled_path
899+ else :
900+ # Rotate top half path to support all partitions
901+ if fs == 'top' :
902+ rotate , rotate_alt = 0 , 180
903+ elif fs == 'bottom' :
904+ rotate , rotate_alt = 180 , 0
905+ elif fs == 'left' :
906+ rotate , rotate_alt = 90 , 270
907+ else :
908+ rotate , rotate_alt = 270 , 90
909+
910+ self ._path = self ._x_filled_path_t
911+ self ._alt_path = self ._x_filled_path_t
912+ self ._alt_transform = Affine2D ().translate (- 0.5 , - 0.5 )
913+ self ._transform .rotate_deg (rotate )
914+ self ._alt_transform .rotate_deg (rotate_alt )
0 commit comments