Overview
Community Forums
Content Tools
This is a single cell notebook with example of advanced plotting of total amount of clouds symbols.
List of all msymbol parameters you can find in Magics documentation.
More symbol plotting examples can be found in Simple symbol plotting and Advanced symbol plotting notebook.
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
import Magics.macro as magics
# Loading data in geopoints format
tcc = magics.mgeo(geo_input_file_name = "../../data/tcc.gpt") # Total cloud amount
#Coastlines
coast = magics.mcoast()
#Geographical projection
central_europe = magics.mmap(
subpage_map_library_area = "on",
subpage_map_area_name = "central_europe",
subpage_clipping = "on",
page_id_line = "off"
)
#Defining the symbols
tcc_symb = magics.msymb(
symbol_advanced_table_height_method = "calculate",
symbol_advanced_table_height_min_value = 1.,
symbol_advanced_table_height_max_value = 1.,
symbol_type = "marker",
legend = "on",
symbol_table_mode = "advanced",
symbol_marker_mode = "name",
symbol_advanced_table_selection_type = "list",
symbol_advanced_table_colour_method = "list",
symbol_advanced_table_colour_list = ['#696969','#5c5c5c','#525252','#464646','#3a3a3a',
'#303030','#262626','#1c1c1c','#101010','#000000'],
symbol_advanced_table_level_list = [0.0,0.1,12.5,25,37.5,50.0,62.5,75.0,87.5,100],
symbol_advanced_table_marker_name_list = ['N_0','N_1','N_2','N_3','N_4','N_5','N_6','N_7','N_8','N_9'])
# Defining the legend
symb_legend = magics.mlegend(
legend_user_lines = ["No clouds","1/8 or less", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"],
legend_box_mode = "positional",
legend_text_composition = "user_text_only",
legend_text_colour = "charcoal",
legend_text_font_size = 0.5,
legend_column_count = 3,
legend_box_y_position = 16.5,
legend_box_x_position = -0.9,
legend_box_x_length = 25.00,
legend_box_y_length = 3.30)
magics.plot(central_europe, tcc, tcc_symb, coast, symb_legend)
Note that these examples are only skeletons to illustrate the functionality of Magics.
You can download this Jupyter notebook and clouds amount data from ECMWF github space.
More about coastline plotting in coastline examples.
More about projections in projection examples.
More about legend plotting in legend tutorial.
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 = "tcc") magics.plot(png, central_europe, tcc, tcc_symb, coast, symb_legend)