fastplotlib.TextGraphic#

class TextGraphic(text, font_size=14, face_color='w', outline_color='w', outline_thickness=0.0, screen_space=True, offset=(0, 0, 0), anchor='middle-center', **kwargs)[source]#

Create a text Graphic

Parameters:
  • text (str) – text to display

  • font_size (float | int, default 10) – font size

  • face_color (str, array, list, tuple, default "w") – str or RGBA array to set the color of the text

  • outline_color (str, array, list, tuple, default "w") – str or RGBA array to set the outline color of the text

  • outline_thickness (float, default 0) – relative outline thickness, value between 0.0 - 0.5

  • screen_space (bool = True) – if True, text size is in screen space, if False the text size is in data space

  • offset ((float, float, float), default (0, 0, 0)) – places the text at this location

  • anchor (str, default "middle-center") –

    position of the origin of the text a string representing the vertical and horizontal anchors, separated by a dash

    • Vertical values: “top”, “middle”, “baseline”, “bottom”

    • Horizontal values: “left”, “center”, “right”

  • **kwargs – passed to Graphic

Examples#

Linear Selectors

Linear Selectors

Rotate image

Rotate image

Rotate line

Rotate line

Scale image

Scale image

Scale line

Scale line

Translate image

Translate image

Translate line

Translate line

Translate and scale image

Translate and scale image

Translate and scale line

Translate and scale line

Translate scale and rotate image

Translate scale and rotate image

Translate scale and rotate line

Translate scale and rotate line

Moving TextGraphic label

Moving TextGraphic label