Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll pdf ignore
Panel
titleDownload
Expand
titleClick here for files to download...
Excerpt Include
A Quick Tour of Metview
A Quick Tour of Metview
nopaneltrue

Attachments
uploadfalse
oldfalse
patterns*.tar.gz,*.grib,*.grb
sortByname

Text Plotting

...

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 Count1
Text Line 1<magics_title/>

So we have a single-line title which uses the default content defined by Magics, Metview's plotting engine.

...

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 ColourText FontText 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 ModePositional
Text Box X PositionX coordinate of lower left corner of text box (in cm)
Text Box Y PositionY coordinate of lower left corner of text box (in cm)
Text Box X LengthWidth of the box (in cm)
Text Box Y LengthHeight of the box (in cm)
Text Box BlankingOn
Text BorderOn

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!

...

Code Block
languagepy
 field_name = grib_get_string(rh[1], 'name') & ' / ' & grib_get_string(z[1], 'name')

Extra Work

Meta-data references in Macro

Continue the work of updating the macro   to use nothing but meta-data references so that it does not extract anything from the GRIB header itself and everything is taken at plot time.

Also, the title just shows the date - add the time of the data.

Text boxes

To exemplify the Text Plotting's dropping rules, do the following:

...

Next, create a Macro program, name it custom_text_boxes, using all the above icons.

Meta-data references in Macro

The title just shows the date - add the time of the data.