@@ -3976,16 +3976,18 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
39763976 if not self ._hold : self .cla ()
39773977
39783978 syms = { # a dict from symbol to (numsides, angle)
3979- 's' : (4 , math .pi / 4.0 ), # square
3980- 'o' : (20 , 0 ), # circle
3981- '^' : (3 ,0 ), # triangle up
3982- '>' : (3 ,math .pi / 2.0 ), # triangle right
3983- 'v' : (3 ,math .pi ), # triangle down
3984- '<' : (3 ,3 * math .pi / 2.0 ), # triangle left
3985- 'd' : (4 ,0 ), # diamond
3986- 'p' : (5 ,0 ), # pentagram
3987- 'h' : (6 ,0 ), # hexagon
3988- '8' : (8 ,0 ), # octagon
3979+ 's' : (4 ,math .pi / 4.0 ,0 ), # square
3980+ 'o' : (20 ,0 ,0 ), # circle
3981+ '^' : (3 ,0 ,0 ), # triangle up
3982+ '>' : (3 ,math .pi / 2.0 ,0 ), # triangle right
3983+ 'v' : (3 ,math .pi ,0 ), # triangle down
3984+ '<' : (3 ,3 * math .pi / 2.0 ,0 ), # triangle left
3985+ 'd' : (4 ,0 ,0 ), # diamond
3986+ 'p' : (5 ,0 ,0 ), # pentagram
3987+ 'h' : (6 ,0 ,0 ), # hexagon
3988+ '8' : (8 ,0 ,0 ), # octagon
3989+ '+' : (4 ,0 ,2 ), # plus
3990+ 'x' : (4 ,math .pi / 4.0 ,2 ) # cross
39893991 }
39903992
39913993 self ._process_unit_info (xdata = x , ydata = y , kwargs = kwargs )
@@ -4013,7 +4015,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40134015 else : edgecolors = 'None'
40144016
40154017 sym = None
4016- starlike = False
4018+ symstyle = 0
40174019
40184020 # to be API compatible
40194021 if marker is None and not (verts is None ):
@@ -4025,7 +4027,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40254027 sym = syms .get (marker )
40264028 if sym is None and verts is None :
40274029 raise ValueError ('Unknown marker symbol to scatter' )
4028- numsides , rotation = syms [marker ]
4030+ numsides , rotation , symstyle = syms [marker ]
40294031
40304032 elif iterable (marker ):
40314033 # accept marker to be:
@@ -4040,21 +4042,19 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40404042 # (numsides, style, [angle])
40414043
40424044 if len (marker )== 2 :
4043- numsides , rotation = marker [0 ], math . pi / 4 .
4045+ numsides , rotation = marker [0 ], 0 .
40444046 elif len (marker )== 3 :
40454047 numsides , rotation = marker [0 ], marker [2 ]
40464048 sym = True
40474049
4048- if marker [1 ]== 1 :
4049- # starlike symbol, everthing else is interpreted
4050- # as solid symbol
4051- starlike = True
4050+ if marker [1 ] in (1 ,2 ):
4051+ symstyle = marker [1 ]
40524052
40534053 else :
40544054 verts = npy .asarray (marker [0 ])
40554055
40564056 if sym is not None :
4057- if not starlike :
4057+ if symstyle == 0 :
40584058
40594059 collection = mcoll .RegularPolyCollection (
40604060 self .figure .dpi ,
@@ -4065,7 +4065,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40654065 offsets = zip (x ,y ),
40664066 transOffset = self .transData ,
40674067 )
4068- else :
4068+ elif symstyle == 1 :
40694069 collection = mcoll .StarPolygonCollection (
40704070 self .figure .dpi ,
40714071 numsides , rotation , scales ,
@@ -4075,6 +4075,16 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
40754075 offsets = zip (x ,y ),
40764076 transOffset = self .transData ,
40774077 )
4078+ elif symstyle == 2 :
4079+ collection = mcoll .AsteriskPolygonCollection (
4080+ self .figure .dpi ,
4081+ numsides , rotation , scales ,
4082+ facecolors = colors ,
4083+ edgecolors = edgecolors ,
4084+ linewidths = linewidths ,
4085+ offsets = zip (x ,y ),
4086+ transOffset = self .transData ,
4087+ )
40784088 else :
40794089 # rescale verts
40804090 rescale = npy .sqrt (max (verts [:,0 ]** 2 + verts [:,1 ]** 2 ))
0 commit comments