matplotlib.markers.MarkerStyle#

class matplotlib.markers.MarkerStyle(marker, fillstyle=None, transform=None, capstyle=None, joinstyle=None)[source]#

基类: object

一个表示标记类型的类。

实例是不可变的。如果需要更改任何内容,请创建一个新实例。

属性:
markersdict

所有已知标记。

filled_markerstuple

所有已知的填充标记。这是 markers 的一个子集。

fillstylestuple

支持的填充样式。

参数:
markerstr, array-like, Path, MarkerStyle
  • 另一个 MarkerStyle 实例会复制该 marker 的详细信息。

  • 有关其他可能的标记值,请参阅模块文档字符串 matplotlib.markers

fillstylestr, 默认值: rcParams["markers.fillstyle"] (默认值: 'full')

以下之一:'full'、'left'、'right'、'bottom'、'top'、'none'。

transformTransform, 可选

将与标记的原始变换结合使用的变换。

capstyleCapStyle 或 %(CapStyle)s, 可选

将覆盖标记默认端点样式的端点样式。

joinstyleJoinStyle 或 %(JoinStyle)s, 可选

将覆盖标记默认连接样式的连接样式。

filled_markers = ('.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')#
fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none')#
get_alt_path()[source]#

返回标记交替部分的 Path

对于未填充标记,此值为 None;对于已填充标记,这是用 markerfacecoloralt 绘制的区域。

get_alt_transform()[source]#

返回应用于 Path 的变换,该 Path 来自 MarkerStyle.get_alt_path()

get_capstyle()[source]#
get_fillstyle()[source]#
get_joinstyle()[source]#
get_marker()[source]#
get_path()[source]#

返回标记主要部分的 Path

对于未填充标记,这是整个标记;对于已填充标记,这是用 markerfacecolor 绘制的区域。

get_snap_threshold()[source]#
get_transform()[source]#

返回应用于 Path 的变换,该 Path 来自 MarkerStyle.get_path()

get_user_transform()[source]#

返回用户提供的标记变换部分。

is_filled()[source]#
markers = {' ': 'nothing', '': 'nothing', '*': 'star', '+': 'plus', ',': 'pixel', '.': 'point', '1': 'tri_down', '2': 'tri_up', '3': 'tri_left', '4': 'tri_right', '8': 'octagon', '<': 'triangle_left', '>': 'triangle_right', 'D': 'diamond', 'H': 'hexagon2', 'None': 'nothing', 'P': 'plus_filled', 'X': 'x_filled', '^': 'triangle_up', '_': 'hline', 'd': 'thin_diamond', 'h': 'hexagon1', 'none': 'nothing', 'o': 'circle', 'p': 'pentagon', 's': 'square', 'v': 'triangle_down', 'x': 'x', '|': 'vline', 0: 'tickleft', 1: 'tickright', 10: 'caretupbase', 11: 'caretdownbase', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase'}#
rotated(*, deg=None, rad=None)[source]#

返回此标记按指定角度旋转后的新版本。

参数:
degfloat, 可选

旋转角度(度)。

radfloat, 可选

旋转角度(弧度)。

.. note:: 您必须精确指定 `deg` 或 `rad` 中的一个。
scaled(sx, sy=None)[source]#

返回按指定缩放因子缩放的新标记。

如果未给出 sy,则在 xy 方向上应用相同的缩放。

参数:
sxfloat

X 方向缩放因子。

syfloat, 可选

Y 方向缩放因子。

transformed(transform)[source]#

返回应用了变换的此标记的新版本。

参数:
transformAffine2D

此变换将与当前用户提供的变换相结合。

使用 matplotlib.markers.MarkerStyle 的示例#

标记参考

标记参考

将标记属性映射到多变量数据

将标记属性映射到多变量数据

带方向箭头的椭圆演示

带方向箭头的椭圆演示