Overview
A plot's title should not be underestimated - it provides vital information about what is being displayed.
During the exercises, remember to give your icons useful names!
Automatic Titles
The Text Plotting icon controls the content and appearance of the title. By default, it contains this:
Text Line Count | 1 |
Text Line 1 | <magics_title/> |
So we have a single-line title which uses the default content defined by Magics, Metview's plotting engine.
For GRIB data, the automatic title is constructed using the meta-data from each field in the plot.
For netCDF data, an automatic title consists of the value of the file's title global attribute if it exists.
For ODB data, some information about the number of points plotted and the columns used from the table go into the automatic title.
There is no automatic title for BUFR, geopoints or ASCII table data.
Customising an automatic title
Visualise the supplied GRIB file relative_humidity.grib to see its automatic title.
Create a new Text Plotting icon and try to get the title to look similar to the image above. You should play with the parameters Text Colour, Text Font, Text Font Style and Text Font Size.
Positioning a title
Make a duplicate of your Text Plotting icon. We will move the title to another location in the plot using the new icon. Use the following parameters:
Text Mode | Positional |
Text Box X Position | X coordinate of lower left corner of text box (in cm) |
Text Box Y Position | Y coordinate of lower left corner of text box (in cm) |
Text Box X Length | Width of the box (in cm) |
Text Box Y Length | Height of the box (in cm) |
Text Box Blanking | On |
Text Border | On |
Remember that Metview uses an A4 page by default, which is 29.7cm wide by 21.0cm high. Try to figure out the coordinates of the box, or look in the solutions folder!
Notice that the original title did not disappear - we added a new one! Here are the rules:
- there can be only one Text Plotting icon where Text Mode is Title - dropping new such icons into the plot replace the current title
- dropping Positional Text Plotting icons into the plot add text boxes; but dropping the same Positional icon multiple times (e.g. with modifications in between) will not accumulate - the text box will be updated
All of this means that if we want to remove the title at the top, we must create an empty title - a default Text Plotting icon with Text Line Count set to 0 will do the trick.
User Defined Titles
If you know (or can figure out from some Macro code) exactly what your plot is going to show, then you can construct a title with no automatically computed elements. Or you can combine the two.
Create a new Text Plotting icon and set Text Line Count to 2. Leave the automatic title in line 1. We will create a nicely formatted line of text using HTML notation. Enter the following text into line 2:
My title which has <b>bold</b>, <u>underlined</u> and <font color='rose'>coloured</font> text