Overview
Community Forums
Content Tools
This is one cell notebook example that will help you set cylindrical projection using Magics.
Magics supports several different projections, and they are controled using mmap funciton.
List of all mmap parameters and projections you can find in Magics documentation.
If you don't have Magics installed, run the next cell to install Magics using conda.
# Install Magics in the current Jupyter kernel
import sys
!conda install --yes --prefix {sys.prefix} Magics
You can change the view playing with the values for
subpage_lower_left_latitude,
subpage_lower_left_longitude,
subpage_upper_right_latitude and
subpage_upper_right_longitude
import Magics.macro as magics
# Setting the projection
projection = magics.mmap(
subpage_upper_right_longitude = 180.00,
subpage_upper_right_latitude = 0.00,
subpage_lower_left_latitude = -50.00,
subpage_lower_left_longitude = 100.00,
subpage_map_projection = "cylindrical",
page_id_line = "off")
# Defining the coastlines
coast = magics.mcoast(
map_coastline_resolution = "high",
map_coastline_colour = "tan",
map_coastline_land_shade = "on",
map_coastline_land_shade_colour = "cream",
map_grid = "on",
map_grid_line_style = "dot",
map_grid_colour = "tan"
)
magics.plot(projection, coast)
Note that these examples are only skeletons to illustrate the functionality of Magics.
You can download this Jupyter notebook from the ECMWF github space.
More about coastline plotting in coastline examples.
Plotting in directly in Jupyter notebooks doesn't need output to be specified. Most of the time you will want an output.
png = magics.output( output_formats = ['png'], output_name_first_page_number = "off", output_name = "my_png") magics.plot(png, projection, coast)