本文整理汇总了Python中matplotlib.markers.MarkerStyle.is_filled方法的典型用法代码示例。如果您正苦于以下问题:Python MarkerStyle.is_filled方法的具体用法?Python MarkerStyle.is_filled怎么用?Python MarkerStyle.is_filled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.markers.MarkerStyle
的用法示例。
在下文中一共展示了MarkerStyle.is_filled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scatter
# 需要导入模块: from matplotlib.markers import MarkerStyle [as 别名]
# 或者: from matplotlib.markers.MarkerStyle import is_filled [as 别名]
def scatter(self, x, y, s, ax=None, fancy=False, **kwargs):
""" takes data coordinate x, y and plot them to a data coordinate axes,
s is the radius in data units.
When fancy is True, apply a radient filter so that the
edge is blent into the background; better with marker='o' or marker='+'. """
X, Y, S = numpy.asarray([x, y, s])
if ax is None: ax=self.default_axes
def filter(image, dpi):
# this is problematic if the marker is clipped.
if image.shape[0] <=1 and image.shape[1] <=1: return image
xgrad = 1.0 \
- numpy.fabs(numpy.linspace(0, 2,
image.shape[0], endpoint=True) - 1.0)
ygrad = 1.0 \
- numpy.fabs(numpy.linspace(0, 2,
image.shape[1], endpoint=True) - 1.0)
image[..., 3] *= xgrad[:, None] ** 0.5
image[..., 3] *= ygrad[None, :] ** 0.5
return image, 0, 0
marker = kwargs.pop('marker', 'x')
verts = kwargs.pop('verts', None)
# to be API compatible
if marker is None and not (verts is None):
marker = (verts, 0)
verts = None
objs = []
color = kwargs.pop('color', None)
edgecolor = kwargs.pop('edgecolor', None)
linewidth = kwargs.pop('linewidth', kwargs.pop('lw', None))
marker_obj = MarkerStyle(marker)
if not marker_obj.is_filled():
edgecolor = color
for x,y,r in numpy.nditer([X, Y, S], flags=['zerosize_ok']):
path = marker_obj.get_path().transformed(
marker_obj.get_transform().scale(r).translate(x, y))
obj = PathPatch(
path,
facecolor = color,
edgecolor = edgecolor,
linewidth = linewidth,
transform = ax.transData,
)
obj.set_alpha(1.0)
if fancy:
obj.set_agg_filter(filter)
obj.rasterized = True
objs += [obj]
ax.add_artist(obj)
ax.autoscale_view()
return objs
示例2: Line2D
# 需要导入模块: from matplotlib.markers import MarkerStyle [as 别名]
# 或者: from matplotlib.markers.MarkerStyle import is_filled [as 别名]
#.........这里部分代码省略.........
renderer.draw_markers(
gc, alt_marker_path, alt_marker_trans, subsampled,
affine.frozen(), rgbaFaceAlt)
gc.restore()
renderer.close_group('line2d')
self.stale = False
def get_antialiased(self):
return self._antialiased
def get_color(self):
return self._color
def get_drawstyle(self):
return self._drawstyle
def get_linestyle(self):
return self._linestyle
def get_linewidth(self):
return self._linewidth
def get_marker(self):
return self._marker.get_marker()
def get_markeredgecolor(self):
mec = self._markeredgecolor
if (is_string_like(mec) and mec == 'auto'):
if rcParams['_internal.classic_mode']:
if self._marker.get_marker() in ('.', ','):
return self._color
if self._marker.is_filled() and self.get_fillstyle() != 'none':
return 'k' # Bad hard-wired default...
return self._color
else:
return mec
def get_markeredgewidth(self):
return self._markeredgewidth
def _get_markerfacecolor(self, alt=False):
if alt:
fc = self._markerfacecoloralt
else:
fc = self._markerfacecolor
if (is_string_like(fc) and fc.lower() == 'auto'):
if self.get_fillstyle() == 'none':
return 'none'
else:
return self._color
else:
return fc
def get_markerfacecolor(self):
return self._get_markerfacecolor(alt=False)
def get_markerfacecoloralt(self):
return self._get_markerfacecolor(alt=True)
def get_markersize(self):
return self._markersize
def get_data(self, orig=True):
示例3: Line2D
# 需要导入模块: from matplotlib.markers import MarkerStyle [as 别名]
# 或者: from matplotlib.markers.MarkerStyle import is_filled [as 别名]
#.........这里部分代码省略.........
# Don't scale for pixels, and don't stroke them
marker_trans = marker_trans.scale(w)
else:
gc.set_linewidth(0)
renderer.draw_markers(
gc, marker_path, marker_trans, subsampled, affine.frozen(),
rgbFace)
alt_marker_path = marker.get_alt_path()
if alt_marker_path:
alt_marker_trans = marker.get_alt_transform()
alt_marker_trans = alt_marker_trans.scale(w)
renderer.draw_markers(
gc, alt_marker_path, alt_marker_trans, subsampled,
affine.frozen(), rgbFaceAlt)
gc.restore()
gc.restore()
renderer.close_group('line2d')
def get_antialiased(self): return self._antialiased
def get_color(self): return self._color
def get_drawstyle(self): return self._drawstyle
def get_linestyle(self): return self._linestyle
def get_linewidth(self): return self._linewidth
def get_marker(self): return self._marker.get_marker()
def get_markeredgecolor(self):
mec = self._markeredgecolor
if (is_string_like(mec) and mec == 'auto'):
if self._marker.get_marker() in ('.', ','):
return self._color
if self._marker.is_filled() and self.get_fillstyle() != 'none':
return 'k' # Bad hard-wired default...
else:
return self._color
else:
return mec
def get_markeredgewidth(self): return self._markeredgewidth
def _get_markerfacecolor(self, alt=False):
if alt:
fc = self._markerfacecoloralt
else:
fc = self._markerfacecolor
if (is_string_like(fc) and fc.lower() == 'auto'):
if self.get_fillstyle() == 'none':
return 'none'
else:
return self._color
else:
return fc
def get_markerfacecolor(self):
return self._get_markerfacecolor(alt=False)
def get_markerfacecoloralt(self):
return self._get_markerfacecolor(alt=True)
def get_markersize(self): return self._markersize
def get_data(self, orig=True):
"""