...
In this exercise, we want to visualise a matrix stored in a Netdef Netcdf file. Netcdf is a very generic format, and can contain a lot of data. The user needs to set up some information in order to explain to Magics which variable to plot, and how to interpret it.
...
Section | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Creating a nice shading
Now, we just create a nice polygon shading.
The list of levels we want to use is : [-200., -100., -75., -50., -30., -20., -15., -13., -11., -9., -7., -5., -3., -1., 1., 3., 5., 7., 9., 11., 13., 15., 20., 30., 50., 75., 100., 200].
and the list of colours is : ["rgb(0,0,0.3)", "rgb(0,0,0.5)", "rgb(0,0,0.7)", "rgb(0,0,0.9)", "rgb(0,0.15,1)", "rgb(0,0.3,1)", "rgb(0,0.45,1)", "rgb(0,0.6,1)", "rgb(0,0.75,1)", "rgb(0,0.85,1)", "rgb(0.2,0.95,1)", "rgb(0.45,1,1)", "rgb(0.75,1,1)", "none", "rgb(1,1,0)","rgb(1,0.9,0)", "rgb(1,0.8,0)", "rgb(1,0.7,0)", "rgb(1,0.6,0)", "rgb(1,0.5,0)", "rgb(1,0.4,0)", "rgb(1,0.3,0)", "rgb(1,0.15,0)", "rgb(0.9,0,0)", "rgb(0.7,0,0)", "rgb(0.5,0,0)", "rgb(0.3,0,0)"],
Do not forget to trun the legend on ...
You could quickly check Contour Documentation
Section | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Position the legend
By default, the legend is is positioned at the top of the plot. In this exercise we want to put see our legend on a column mode on the right of the plot.
The Information about the positional mode can be found in the Legend Documentation
Column | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
|
Column | ||
---|---|---|
| ||
add a Title
Last thing to do here .. We add a title to the top..
Here we will use a combination of User text and automatic text ( read from the Netcdf global attribute title)
To get the automatic title, you have to use the following tag <magics_title/>
Column | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
|