mpl_speech_bubble.speech_bubble.AnnotationMergedPatch

class mpl_speech_bubble.speech_bubble.AnnotationMergedPatch(*kl, **kwargs)
Attributes:
anncoords

The coordinate system to use for .Annotation.xyann.

axes

The ~.axes.Axes instance the artist resides in, or None.

mouseover

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

stale

Whether the artist is ‘stale’ and needs to be re-drawn for the output to match the internal state of the artist.

sticky_edges

x and y sticky edge lists for autoscaling.

xyann

The text position.

xycoords

Methods

add_callback(func)

Add a callback function that will be called whenever one of the .Artist's properties changes.

contains(mouseevent)

Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.

convert_xunits(x)

Convert x using the unit type of the xaxis.

convert_yunits(y)

Convert y using the unit type of the yaxis.

draggable([state, use_blit])

Set whether the annotation is draggable with the mouse.

draw(renderer)

Draw the Artist (and its children) using the given renderer.

findobj([match, include_self])

Find artist objects.

format_cursor_data(data)

Return a string representation of data.

get_agg_filter()

Return filter function to be used for agg filter.

get_alpha()

Return the alpha value used for blending - not supported on all backends.

get_animated()

Return whether the artist is animated.

get_anncoords()

Return the coordinate system to use for .Annotation.xyann.

get_annotation_clip()

Return the annotation's clipping behavior.

get_antialiased()

Return whether antialiased rendering is used.

get_bbox_patch()

Return the bbox Patch, or None if the .patches.FancyBboxPatch is not made.

get_c()

Alias for get_color.

get_children()

Return a list of the child .Artists of this .Artist.

get_clip_box()

Return the clipbox.

get_clip_on()

Return whether the artist uses clipping.

get_clip_path()

Return the clip path.

get_color()

Return the color of the text.

get_cursor_data(event)

Return the cursor data for a given event.

get_family()

Alias for get_fontfamily.

get_figure()

Return the .Figure instance the artist belongs to.

get_font()

Alias for get_fontproperties.

get_font_properties()

Alias for get_fontproperties.

get_fontfamily()

Return the list of font families used for font lookup.

get_fontname()

Return the font name as a string.

get_fontproperties()

Return the .font_manager.FontProperties.

get_fontsize()

Return the font size as an integer.

get_fontstyle()

Return the font style as a string.

get_fontvariant()

Return the font variant as a string.

get_fontweight()

Return the font weight as a string or a number.

get_gid()

Return the group id.

get_ha()

Alias for get_horizontalalignment.

get_horizontalalignment()

Return the horizontal alignment as a string.

get_in_layout()

Return boolean flag, True if artist is included in layout calculations.

get_label()

Return the label used for this artist in the legend.

get_math_fontfamily()

Return the font family name for math text rendered by Matplotlib.

get_mouseover()

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

get_name()

Alias for get_fontname.

get_parse_math()

Return whether mathtext parsing is considered for this Text.

get_picker()

Return the picking behavior of the artist.

get_position()

Return the (x, y) position of the text.

get_rasterized()

Return whether the artist is to be rasterized.

get_rotation()

Return the text angle in degrees between 0 and 360.

get_rotation_mode()

Return the text rotation mode.

get_size()

Alias for get_fontsize.

get_sketch_params()

Return the sketch parameters for the artist.

get_snap()

Return the snap setting.

get_stretch()

Return the font stretch as a string or a number.

get_style()

Alias for get_fontstyle.

get_text()

Return the text string.

get_tightbbox([renderer])

Like .Artist.get_window_extent, but includes any clipping.

get_transform()

Return the .Transform instance used by this artist.

get_transform_rotates_text()

Return whether rotations of the transform affect the text direction.

get_transformed_clip_path_and_affine()

Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.

get_unitless_position()

Return the (x, y) unitless position of the text.

get_url()

Return the url.

get_usetex()

Return whether this Text object uses TeX for rendering.

get_va()

Alias for get_verticalalignment.

get_variant()

Alias for get_fontvariant.

get_verticalalignment()

Return the vertical alignment as a string.

get_visible()

Return the visibility.

get_weight()

Alias for get_fontweight.

get_window_extent([renderer])

Return the .Bbox bounding the text, in display units.

get_wrap()

Return whether the text can be wrapped.

get_zorder()

Return the artist's zorder.

have_units()

Return whether units are set on any axis.

is_transform_set()

Return whether the Artist has an explicitly set transform.

pchanged()

Call all of the registered callbacks.

pick(mouseevent)

Process a pick event.

pickable()

Return whether the artist is pickable.

properties()

Return a dictionary of all the properties of the artist.

remove()

Remove the artist from the figure if possible.

remove_callback(oid)

Remove a callback based on its observer id.

set(*[, agg_filter, alpha, animated, ...])

Set multiple properties at once.

set_agg_filter(filter_func)

Set the agg filter.

set_alpha(alpha)

Set the alpha value used for blending - not supported on all backends.

set_animated(b)

Set whether the artist is intended to be used in an animation.

set_anncoords(coords)

Set the coordinate system to use for .Annotation.xyann.

set_annotation_clip(b)

Set the annotation's clipping behavior.

set_antialiased(antialiased)

Set whether to use antialiased rendering.

set_backgroundcolor(color)

Set the background color of the text by updating the bbox.

set_bbox(rectprops)

Draw a bounding box around self.

set_c(color)

Alias for set_color.

set_clip_box(clipbox)

Set the artist's clip .Bbox.

set_clip_on(b)

Set whether the artist uses clipping.

set_clip_path(path[, transform])

Set the artist's clip path.

set_color(color)

Set the foreground color of the text

set_family(fontname)

Alias for set_fontfamily.

set_figure(fig)

Set the .Figure instance the artist belongs to.

set_font(fp)

Alias for set_fontproperties.

set_font_properties(fp)

Alias for set_fontproperties.

set_fontfamily(fontname)

Set the font family.

set_fontname(fontname)

Alias for set_fontfamily.

set_fontproperties(fp)

Set the font properties that control the text.

set_fontsize(fontsize)

Set the font size.

set_fontstretch(stretch)

Set the font stretch (horizontal condensation or expansion).

set_fontstyle(fontstyle)

Set the font style.

set_fontvariant(variant)

Set the font variant.

set_fontweight(weight)

Set the font weight.

set_gid(gid)

Set the (group) id for the artist.

set_ha(align)

Alias for set_horizontalalignment.

set_horizontalalignment(align)

Set the horizontal alignment relative to the anchor point.

set_in_layout(in_layout)

Set if artist is to be included in layout calculations, E.g.

set_label(s)

Set a label that will be displayed in the legend.

set_linespacing(spacing)

Set the line spacing as a multiple of the font size.

set_ma(align)

Alias for set_multialignment.

set_math_fontfamily(fontfamily)

Set the font family for math text rendered by Matplotlib.

set_mouseover(mouseover)

Set whether this artist is queried for custom context information when the mouse cursor moves over it.

set_multialignment(align)

Set the text alignment for multiline texts.

set_name(fontname)

Alias for set_fontname.

set_parse_math(parse_math)

Override switch to disable any mathtext parsing for this Text.

set_path_effects(path_effects)

Set the path effects.

set_picker(picker)

Define the picking behavior of the artist.

set_position(xy)

Set the (x, y) position of the text.

set_rasterized(rasterized)

Force rasterized (bitmap) drawing for vector graphics output.

set_rotation(s)

Set the rotation of the text.

set_rotation_mode(m)

Set text rotation mode.

set_size(fontsize)

Alias for set_fontsize.

set_sketch_params([scale, length, randomness])

Set the sketch parameters.

set_snap(snap)

Set the snapping behavior.

set_stretch(stretch)

Alias for set_fontstretch.

set_style(fontstyle)

Alias for set_fontstyle.

set_text(s)

Set the text string s.

set_transform(t)

Set the artist transform.

set_transform_rotates_text(t)

Whether rotations of the transform affect the text direction.

set_url(url)

Set the url for the artist.

set_usetex(usetex)

param usetex:

Whether to render using TeX, None means to use

set_va(align)

Alias for set_verticalalignment.

set_variant(variant)

Alias for set_fontvariant.

set_verticalalignment(align)

Set the vertical alignment relative to the anchor point.

set_visible(b)

Set the artist's visibility.

set_weight(weight)

Alias for set_fontweight.

set_wrap(wrap)

Set whether the text can be wrapped.

set_x(x)

Set the x position of the text.

set_y(y)

Set the y position of the text.

set_zorder(level)

Set the zorder for the artist.

update(kwargs)

Update this artist's properties from the dict props.

update_bbox_position_size(renderer)

Update the location and the size of the bbox.

update_from(other)

Copy properties from other to self.

update_positions(renderer)

Update the pixel positions of the annotation text and the arrow patch.

get_path_effects

__init__(*kl, **kwargs)

Annotate the point xy with text text.

In the simplest form, the text is placed at xy.

Optionally, the text can be displayed in another position xytext. An arrow pointing from the text to the annotated point xy can then be added by defining arrowprops.

Parameters:
  • text (str) – The text of the annotation.

  • xy ((float, float)) – The point (x, y) to annotate. The coordinate system is determined by xycoords.

  • xytext ((float, float), default: xy) – The position (x, y) to place the text at. The coordinate system is determined by textcoords.

  • xycoords (single or two-tuple of str or .Artist or .Transform or callable, default: ‘data’) –

    The coordinate system that xy is given in. The following types of values are supported:

    • One of the following strings:

      Value

      Description

      ’figure points’

      Points from the lower left of the figure

      ’figure pixels’

      Pixels from the lower left of the figure

      ’figure fraction’

      Fraction of figure from lower left

      ’subfigure points’

      Points from the lower left of the subfigure

      ’subfigure pixels’

      Pixels from the lower left of the subfigure

      ’subfigure fraction’

      Fraction of subfigure from lower left

      ’axes points’

      Points from lower left corner of axes

      ’axes pixels’

      Pixels from lower left corner of axes

      ’axes fraction’

      Fraction of axes from lower left

      ’data’

      Use the coordinate system of the object being annotated (default)

      ’polar’

      (theta, r) if not native ‘data’ coordinates

      Note that ‘subfigure pixels’ and ‘figure pixels’ are the same for the parent figure, so users who want code that is usable in a subfigure can use ‘subfigure pixels’.

    • An .Artist: xy is interpreted as a fraction of the artist’s ~matplotlib.transforms.Bbox. E.g. (0, 0) would be the lower left corner of the bounding box and (0.5, 1) would be the center top of the bounding box.

    • A .Transform to transform xy to screen coordinates.

    • A function with one of the following signatures:

      def transform(renderer) -> Bbox
      def transform(renderer) -> Transform
      

      where renderer is a .RendererBase subclass.

      The result of the function is interpreted like the .Artist and .Transform cases above.

    • A tuple (xcoords, ycoords) specifying separate coordinate systems for x and y. xcoords and ycoords must each be of one of the above described types.

    See plotting-guide-annotation for more details.

  • textcoords (single or two-tuple of str or .Artist or .Transform or callable, default: value of xycoords) –

    The coordinate system that xytext is given in.

    All xycoords values are valid as well as the following strings:

    Value

    Description

    ’offset points’

    Offset, in points, from the xy value

    ’offset pixels’

    Offset, in pixels, from the xy value

    ’offset fontsize’

    Offset, relative to fontsize, from the xy value

  • arrowprops (dict, optional) –

    The properties used to draw a .FancyArrowPatch arrow between the positions xy and xytext. Defaults to None, i.e. no arrow is drawn.

    For historical reasons there are two different ways to specify arrows, “simple” and “fancy”:

    Simple arrow:

    If arrowprops does not contain the key ‘arrowstyle’ the allowed keys are:

    Key

    Description

    width

    The width of the arrow in points

    headwidth

    The width of the base of the arrow head in points

    headlength

    The length of the arrow head in points

    shrink

    Fraction of total length to shrink from both ends

    ?

    Any .FancyArrowPatch property

    The arrow is attached to the edge of the text box, the exact position (corners or centers) depending on where it’s pointing to.

    Fancy arrow:

    This is used if ‘arrowstyle’ is provided in the arrowprops.

    Valid keys are the following .FancyArrowPatch parameters:

    Key

    Description

    arrowstyle

    The arrow style

    connectionstyle

    The connection style

    relpos

    See below; default is (0.5, 0.5)

    patchA

    Default is bounding box of the text

    patchB

    Default is None

    shrinkA

    Default is 2 points

    shrinkB

    Default is 2 points

    mutation_scale

    Default is text size (in points)

    mutation_aspect

    Default is 1

    ?

    Any .FancyArrowPatch property

    The exact starting point position of the arrow is defined by relpos. It’s a tuple of relative coordinates of the text box, where (0, 0) is the lower left corner and (1, 1) is the upper right corner. Values <0 and >1 are supported and specify points outside the text box. By default (0.5, 0.5), so the starting point is centered in the text box.

  • annotation_clip (bool or None, default: None) –

    Whether to clip (i.e. not draw) the annotation when the annotation point xy is outside the axes area.

    • If True, the annotation will be clipped when xy is outside the axes.

    • If False, the annotation will always be drawn.

    • If None, the annotation will be clipped when xy is outside the axes and xycoords is ‘data’.

  • **kwargs – Additional kwargs are passed to .Text.

Return type:

.Annotation

See also

plotting-guide-annotation

Methods

__init__(*kl, **kwargs)

Annotate the point xy with text text.

add_callback(func)

Add a callback function that will be called whenever one of the .Artist's properties changes.

contains(mouseevent)

Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.

convert_xunits(x)

Convert x using the unit type of the xaxis.

convert_yunits(y)

Convert y using the unit type of the yaxis.

draggable([state, use_blit])

Set whether the annotation is draggable with the mouse.

draw(renderer)

Draw the Artist (and its children) using the given renderer.

findobj([match, include_self])

Find artist objects.

format_cursor_data(data)

Return a string representation of data.

get_agg_filter()

Return filter function to be used for agg filter.

get_alpha()

Return the alpha value used for blending - not supported on all backends.

get_animated()

Return whether the artist is animated.

get_anncoords()

Return the coordinate system to use for .Annotation.xyann.

get_annotation_clip()

Return the annotation's clipping behavior.

get_antialiased()

Return whether antialiased rendering is used.

get_bbox_patch()

Return the bbox Patch, or None if the .patches.FancyBboxPatch is not made.

get_c()

Alias for get_color.

get_children()

Return a list of the child .Artists of this .Artist.

get_clip_box()

Return the clipbox.

get_clip_on()

Return whether the artist uses clipping.

get_clip_path()

Return the clip path.

get_color()

Return the color of the text.

get_cursor_data(event)

Return the cursor data for a given event.

get_family()

Alias for get_fontfamily.

get_figure()

Return the .Figure instance the artist belongs to.

get_font()

Alias for get_fontproperties.

get_font_properties()

Alias for get_fontproperties.

get_fontfamily()

Return the list of font families used for font lookup.

get_fontname()

Return the font name as a string.

get_fontproperties()

Return the .font_manager.FontProperties.

get_fontsize()

Return the font size as an integer.

get_fontstyle()

Return the font style as a string.

get_fontvariant()

Return the font variant as a string.

get_fontweight()

Return the font weight as a string or a number.

get_gid()

Return the group id.

get_ha()

Alias for get_horizontalalignment.

get_horizontalalignment()

Return the horizontal alignment as a string.

get_in_layout()

Return boolean flag, True if artist is included in layout calculations.

get_label()

Return the label used for this artist in the legend.

get_math_fontfamily()

Return the font family name for math text rendered by Matplotlib.

get_mouseover()

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

get_name()

Alias for get_fontname.

get_parse_math()

Return whether mathtext parsing is considered for this Text.

get_path_effects()

get_picker()

Return the picking behavior of the artist.

get_position()

Return the (x, y) position of the text.

get_rasterized()

Return whether the artist is to be rasterized.

get_rotation()

Return the text angle in degrees between 0 and 360.

get_rotation_mode()

Return the text rotation mode.

get_size()

Alias for get_fontsize.

get_sketch_params()

Return the sketch parameters for the artist.

get_snap()

Return the snap setting.

get_stretch()

Return the font stretch as a string or a number.

get_style()

Alias for get_fontstyle.

get_text()

Return the text string.

get_tightbbox([renderer])

Like .Artist.get_window_extent, but includes any clipping.

get_transform()

Return the .Transform instance used by this artist.

get_transform_rotates_text()

Return whether rotations of the transform affect the text direction.

get_transformed_clip_path_and_affine()

Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.

get_unitless_position()

Return the (x, y) unitless position of the text.

get_url()

Return the url.

get_usetex()

Return whether this Text object uses TeX for rendering.

get_va()

Alias for get_verticalalignment.

get_variant()

Alias for get_fontvariant.

get_verticalalignment()

Return the vertical alignment as a string.

get_visible()

Return the visibility.

get_weight()

Alias for get_fontweight.

get_window_extent([renderer])

Return the .Bbox bounding the text, in display units.

get_wrap()

Return whether the text can be wrapped.

get_zorder()

Return the artist's zorder.

have_units()

Return whether units are set on any axis.

is_transform_set()

Return whether the Artist has an explicitly set transform.

pchanged()

Call all of the registered callbacks.

pick(mouseevent)

Process a pick event.

pickable()

Return whether the artist is pickable.

properties()

Return a dictionary of all the properties of the artist.

remove()

Remove the artist from the figure if possible.

remove_callback(oid)

Remove a callback based on its observer id.

set(*[, agg_filter, alpha, animated, ...])

Set multiple properties at once.

set_agg_filter(filter_func)

Set the agg filter.

set_alpha(alpha)

Set the alpha value used for blending - not supported on all backends.

set_animated(b)

Set whether the artist is intended to be used in an animation.

set_anncoords(coords)

Set the coordinate system to use for .Annotation.xyann.

set_annotation_clip(b)

Set the annotation's clipping behavior.

set_antialiased(antialiased)

Set whether to use antialiased rendering.

set_backgroundcolor(color)

Set the background color of the text by updating the bbox.

set_bbox(rectprops)

Draw a bounding box around self.

set_c(color)

Alias for set_color.

set_clip_box(clipbox)

Set the artist's clip .Bbox.

set_clip_on(b)

Set whether the artist uses clipping.

set_clip_path(path[, transform])

Set the artist's clip path.

set_color(color)

Set the foreground color of the text

set_family(fontname)

Alias for set_fontfamily.

set_figure(fig)

Set the .Figure instance the artist belongs to.

set_font(fp)

Alias for set_fontproperties.

set_font_properties(fp)

Alias for set_fontproperties.

set_fontfamily(fontname)

Set the font family.

set_fontname(fontname)

Alias for set_fontfamily.

set_fontproperties(fp)

Set the font properties that control the text.

set_fontsize(fontsize)

Set the font size.

set_fontstretch(stretch)

Set the font stretch (horizontal condensation or expansion).

set_fontstyle(fontstyle)

Set the font style.

set_fontvariant(variant)

Set the font variant.

set_fontweight(weight)

Set the font weight.

set_gid(gid)

Set the (group) id for the artist.

set_ha(align)

Alias for set_horizontalalignment.

set_horizontalalignment(align)

Set the horizontal alignment relative to the anchor point.

set_in_layout(in_layout)

Set if artist is to be included in layout calculations, E.g.

set_label(s)

Set a label that will be displayed in the legend.

set_linespacing(spacing)

Set the line spacing as a multiple of the font size.

set_ma(align)

Alias for set_multialignment.

set_math_fontfamily(fontfamily)

Set the font family for math text rendered by Matplotlib.

set_mouseover(mouseover)

Set whether this artist is queried for custom context information when the mouse cursor moves over it.

set_multialignment(align)

Set the text alignment for multiline texts.

set_name(fontname)

Alias for set_fontname.

set_parse_math(parse_math)

Override switch to disable any mathtext parsing for this Text.

set_path_effects(path_effects)

Set the path effects.

set_picker(picker)

Define the picking behavior of the artist.

set_position(xy)

Set the (x, y) position of the text.

set_rasterized(rasterized)

Force rasterized (bitmap) drawing for vector graphics output.

set_rotation(s)

Set the rotation of the text.

set_rotation_mode(m)

Set text rotation mode.

set_size(fontsize)

Alias for set_fontsize.

set_sketch_params([scale, length, randomness])

Set the sketch parameters.

set_snap(snap)

Set the snapping behavior.

set_stretch(stretch)

Alias for set_fontstretch.

set_style(fontstyle)

Alias for set_fontstyle.

set_text(s)

Set the text string s.

set_transform(t)

Set the artist transform.

set_transform_rotates_text(t)

Whether rotations of the transform affect the text direction.

set_url(url)

Set the url for the artist.

set_usetex(usetex)

param usetex:

Whether to render using TeX, None means to use

set_va(align)

Alias for set_verticalalignment.

set_variant(variant)

Alias for set_fontvariant.

set_verticalalignment(align)

Set the vertical alignment relative to the anchor point.

set_visible(b)

Set the artist's visibility.

set_weight(weight)

Alias for set_fontweight.

set_wrap(wrap)

Set whether the text can be wrapped.

set_x(x)

Set the x position of the text.

set_y(y)

Set the y position of the text.

set_zorder(level)

Set the zorder for the artist.

update(kwargs)

Update this artist's properties from the dict props.

update_bbox_position_size(renderer)

Update the location and the size of the bbox.

update_from(other)

Copy properties from other to self.

update_positions(renderer)

Update the pixel positions of the annotation text and the arrow patch.

Attributes

anncoords

The coordinate system to use for .Annotation.xyann.

axes

The ~.axes.Axes instance the artist resides in, or None.

mouseover

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

stale

Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.

sticky_edges

x and y sticky edge lists for autoscaling.

xyann

The text position.

xycoords

zorder