	program magics

	call popen

	call pset1c("output_formats", (/"png"/), 1)
	call psetc("output_name", "legend2")
	call psetc("output_name_first_page_number", "off")

	call psetr("subpage_upper_right_longitude", 65.00)
	call psetr("subpage_upper_right_latitude", 51.28)
	call psetr("subpage_lower_left_latitude", 21.51)
	call psetr("subpage_map_vertical_longitude", 0.00)
	call psetr("subpage_lower_left_longitude", -37.27)
	call psetc("subpage_map_projection", "polar_stereographic")

	call psetc("grib_id", "t850")
	call psetc("grib_input_file_name", "./t850.grb")
	call pgrib

	call psetc("contour_level_selection_type", "level_list")
	call psetc("contour_shade_colour_method", "list")
	call psetc("contour_shade_method", "area_fill")
	call psetc("contour_shade", "on")
	call pset1r("contour_level_list", (/-48.00, -10.00, 0.00, 10.00, 20.00, 48.00/), 6)
	call psetr("contour_shade_max_level", 48.00)
	call psetc("contour_hilo", "off")
	call psetc("contour", "off")
	call psetc("contour_label", "off")
	call psetr("contour_shade_min_level", -48.00)
	call psetc("legend", "on")
	call pset1c("contour_shade_colour_list", (/"blue_purple", "greenish_blue", "blue_green", "yellow_green", "yellow", "orange"/), 6)
	call pcont

	call psetc("map_coastline_resolution", "high")
	call psetc("map_grid_colour", "tan")
	call psetc("map_grid", "on")
	call psetc("map_coastline_colour", "tan")
	call pcoast

	call pset1c("text_lines", (/"<font size='1'>Disjoint legend with user defined labels</font>", ""/), 2)
	call psetr("text_font_size", 0.50)
	call psetc("text_justification", "left")
	call psetc("text_colour", "charcoal")
	call ptext

	call psetc("legend_display_type", "disjoint")
	call psetc("legend_text_composition", "user_text_only")
	call psetc("legend_title", "on")
	call pset1c("legend_user_lines", (/"extremely cold", "very cold", "cold", "temperate", "hot"/), 5)
	call psetc("legend_text_font_size", "0.5")
	call psetc("legend_text_colour", "black")
	call psetr("legend_entry_text_width", 80.00)
	call psetc("legend", "on")
	call psetc("legend_title_text", "Temperature at 850 hPa")

	call pclose

	end
