ws_text

../../_images/WS_TEXT.png

Defines a text Weather Symbol Object that can be visualised with plot().

New in Metview version 5.15.0.

Warning

The script-based Weather Symbol Object visualisation is currently restricted to the ‘screen’ output target (i.e. when the output is Metview’s plot window). On the one hand this requires the Metview GUI to be installed, on the other hand it limits the script-based visualisation to these cases:

  • execute the code in Metview’s Code Editor (the default output target here is already ‘screen’)

  • execute the code as a Jupyter notebook with the output target set to ‘screen’ (see setoutput()):

In any other cases, e.g. in batch mode, plot() does not work.

Note

This function performs the same task as the Ws Text icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.

ws_text(**kwargs)

Defines a text Weather Symbol Object.

Parameters
  • text (str) – The text.

  • font_family ({"arial", "courier", "helvetica", "times", "serif", "sansserif"}, default: "sansserif") – Font family.

  • font_size (number, default: 14) – Font size in points.

  • font_bold_style ({"on", "off"}, default: "off") – Enable bold style.

  • font_italic_style ({"on", "off"}, default: "off") – Enable italic style.

  • font_underline_style ({"on", "off"}, default: "off") – Enable underline style.

  • font_colour (str, default: "black") – Font colour.

  • text_alignment ({"left", "centre", "right", "justify"}, default: "left") – Text alignment.

  • line ({"on", "off"}, default: "on") – Enable to draw text box outline.

  • line_colour (str, default: "black") – Colour of the text box outline. Enabled when line is “on”.

  • line_thickness (number, default: 1) – Thickness of the text box outline. Enabled when line is “on”.

  • line_style ({"solid", "dash", "dot", "dash_dot", "dash_dot_dot"}, default: "solid") – Style of the text box outline. Enabled when line is “on”.

  • fill ({"on", "off"}, default: "off") – Enable to fill the text box.

  • fill_colour (str, default: "rgb(0.8,0.8,0.8)") – Fill colour of the text box. Enabled when fill is “on”.

  • width (number, default: 0) – Width of the text box.

  • height (number, default: 0) – Height of the text box.

  • x (ndarray or list of numbers, default: 0) – The x coordinate of the top-left point of the text box.

  • y (ndarray or list of numbers, default: 0) – The y coordinate of top-left point of the text box.

  • x – The x coordinates of the control points of the curve.

  • y – The y coordinates of the control points of the curve.

  • geolock (on_off, default: off) – Sets the geolock on the item for interactive editing in the plot window.

  • tooltip (str) – Text that appears as a tooltip when the visualised object is hovered over in Metview’s plot window.

Return type

Request