annotate

click_callbacks.annotate(pos_precision=4, val_precision=4, permanent=False, text=None, zorder=20, layer=None, **kwargs)

Add a basic text-annotation to the plot at the position where the map was clicked.

Parameters
  • pos_precision (int) – The floating-point precision of the coordinates. The default is 4.

  • val_precision (int) – The floating-point precision of the parameter-values (only used if β€œval_fmt=None”). The default is 4.

  • permanent (bool or None) –

    Indicator if the annotation should be temporary (False) or permanent (True).

    If True, the generated annotations are stored in a list which is accessible via m.cb.[click/pick].get.permanent_annotations

    If None, the artists will be permanent but NOT added to the permanent_annotations list!

    The default is False

  • text (callable or str, optional) –

    if str: the string to print if callable: A function that returns the string that should be printed in the annotation with the following call-signature:

    >>> def text(m, ID, val, pos, ind):
    >>>     # m   ... the Maps object
    >>>     # ID  ... the ID in the dataframe
    >>>     # pos ... the position
    >>>     # val ... the value
    >>>     # ind ... the index
    >>>
    >>>     return "the string to print"
    

    The default is None.

  • zorder (int or float) –

    The zorder of the artist. (e.g. the drawing-order) For details, have a look at:

    The default is 20

  • layer (str or None, optional) – The layer to put the marker on. If None, the layer associated with the used Maps-object (e.g. m.layer) The default is None

  • kwargs –

    kwargs passed to matplotlib.pyplot.annotate(). The default is:

    >>> dict(xytext=(20, 20),
    >>>      textcoords="offset points",
    >>>      bbox=dict(boxstyle="round", fc="w"),
    >>>      arrowprops=dict(arrowstyle="->")
    >>>     )