update_text

AnnotationEditor.update_text(text, what='all')

Update the text of one (or more) annotations.

You can either provide a static string, or a function that is used to dynamically update the annotation-text

Parameters:
  • text (str or callable) –

    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
    >>>     # pos ... the position
    >>>     # val ... the value
    >>>     # ind ... the index of the clicked pixel
    >>>
    >>>     return "the string to print"
    

  • what (TYPE, optional) – DESCRIPTION. The default is β€œall”.