Objectives
- Set-up a cylindrical projection over the United States.
- Apply land-shading on the coastlines.
- Load a grib file containing Mean-Sea level Presssure and visualise it using black isolines.
- Load a grib file containing Precipitation and visualise it using shading technique.
- Add a legend.
- Add a text.
- Draw the position of New-York City
- Draw a line to materialise the Xsection we are going to visualise in a next tutorial
You will need to download
Setting of the geographical area
The Geographical area we want to work with today is defined by its lower-left corner [20oN, 110oE] and its upper-right corner [70oN, 30oE].
Have a look at the subpage documentation to learn how to setup a projection .
Parameters to check
subpage_lower_left_longitude |
subpage_lower_left_latitude |
subpage_upper_right_longitude |
subpage_upper_right_latitude |
Setting the coastlines
Until now you have used the mcoast to add coastlines to your plot. The mcoast object comes with a lot of parameters to allow you to style your coastlines layer.
The full list of parameters can be found in the Coastlines documentation.
In this first exercise, we will like to see:
- The land coloured in cream.
- The coastlines in grey.
- The grid as a grey dash line.
Parameters to check
map_coastline_land_shade |
map_coastline_land_shade_colour |
map_coastline_colour |
map_grid_colour |
map_grid_line_style |
Visualising the Mean Sea Level Pressure field
The visualisation of any data in Magics is done by combining 2 kind of objects. One, the Data Action, is used to define the data and explain to Magics how to interpret it, the other one is called Visual Action and will define the type of visualisation and its attributes.
In this example our data are in a grib file msl.grib. The Data Action to be used is mgrib in is documented in Grib Input Documentation.
The Visualisation we want to apply is a basic contouring, using black for the lines and an interval of 5 hPa, between isolines. We also want to add a automatic legend, with our own text "Mean Sea Level Pressure". Follow the link to access the Contouring Documentation.
Parameters to check
mgrib action to load the data |
---|
grib_input_file_name |
mcont action to define a contouring |
---|
contour_line_colour |
contour_line_thickness |
contour_highlight_colour |
contour_highlight_thickness |
contour_hilo |
contour_level_selection_type |
contour_interval |
legend |
contour_legend_text |
Adding a text
Magics allows the user to add of or several lines of text. The position of the text is by default above the plot, but some parameters aloow it to be moved around.
A basic html formatting can be used for colour, style, and font size.
The mtext object has to be inserted in the plot command to see the text on the result.