mtext ( macro/python ) ptext(fortran)


Magics can plot text anywhere on a page, the default position  is above the plot, on top of any eventual legend.

The text can be formatted using basic html format such as <font colour='red' > My red text </font> 

Example of Tags  

<magics_title/>

create an automatic title  that contains the major information from the data (parameter, valid-date,level, centre ...)

<grib_info key='shortName"/>

extract the grib_api key shortName from the grib and replace the tag by its value.

<grib_info key='level" where='shortName=t'/>

extract level from the grib that verify the criteria "shortName=t'. This is useful for avoiding multiple title lines when overlaying data.

<grib_info key='valid-date' format='%Y-%m-%d %H:%M:00'/>

build the validity date for the grib, applying the specified format

<netcdf_info variable='var 'attribute='title' default='unknown'/>

use the value of the attribute title from the variable var if exists or use the default
Quick links :

Jupyter notebook:

Gallery:

  • Text Example

5 Comments

  1. Unknown User (tr25)

    <magics_title/>

    Output for this tag starts with 4 spaces, told Sylvie about it.

  2. What is the main text the text_line_*_ratios are referring to?

  3. Apparently Metview 5.1.1 does not even know the text_line_space_ratio...

  4. This is an very old Magics parameter, from the fortran version.

    This idea was to set the font_size for your text, and make use use of the ratio parameter to get one line smaller or larger .

    You can now use the html tag <font/>  to change the size of your text, making these parameters quite obsolete.


    Sylvie


  5. Thanks. I will try that.