Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section

 

 

 

Column
width300px

Column
width50%

 

 

Panel
titleCheck List
  •  Create a Magics python skeleton that displays a global map using the plot command
  •  Create and use an output object to set-up  name and format of your output
  •  Improve mcoast to taylor the coastlines.
  •  Add a mtext object to add some texts.

 

...

First step

In order to be able to create and use Magics objects, the Magics python package has to be imported.

...

Section
Column
width50%

 

 

Code Block
themeConfluence
languagepython
titlePython - Basic
collapsetrue
from Magics.macro import *

plot(mcoast())

 

Create a postscript file called ps.ps, mcoast() create a default coastlines object.

Column
width200px

 

Image Removed 

 


Setting the output

The object outputallows the definition of the output format, and the settings of the output file name .

...

Code Block
themeConfluence
languagepython
titlePython - Output
collapsetrue
from Magics.macro import *

#settings of the png output 
output = output(
			output_formats = ['png'],
  			output_name = "magics",
    		output_name_first_page_number = "off"
    )

#The plot commad will create a png output called magics.png
plot(output, mcoast())

Setting the coastlines

The object mcoast allows the parametrisation of the coastlines.

To configure the look of your coastlines you have to create a mcoast object with the parameters you want.

The object has to be inserted in the plot command.

 

 

 

Section
Column
width50%
Code Block
themeConfluence
languagepython
titlePython - Coastlines
collapsetrue
from Magics.macro import *

#settings of the png output 
output = output(
			output_formats = ['png'],
  			output_name = "coast",
    		output_name_first_page_number = "off"
    )
##settings of the coastlines attributes 
coast = mcoast(
  map_coastline_land_shade = "on",
  map_coastline_land_shade_colour = "cream",
  map_grid_line_style = "dash",
  map_grid_colour = "brown",
  map_label_colour = "brown",
  map_coastline_colour = "brown"
)

#The plot command will now use the coast object
plot(output, coast)
Column
width200px

 Image Added