-
Notifications
You must be signed in to change notification settings - Fork 15
Description
What happened?
There is a magics bug in python/metview by which when specifying a user-defined text legend scale (egend_text_composition="user_text_only"), the penultimate value of the legend is missing and is instead moved to the last position, while the last element doesn't appear at all. See image attached below.
What are the steps to reproduce the bug?
Below the python script I run.
NB. file is available in a public path in my home
import metview as mv
ens_t = mv.read(source="ens_t.grib",number=[1,2,3,4,5,6,7,8,9,10])
spr_t = mv.stdev(ens_t)
max_t = mv.maxvalue(ens_t)
spr_t_norm = spr_t/max_t
print(mv.minvalue(spr_t_norm),mv.maxvalue(spr_t_norm))
cont_spread = mv.mcont(
legend = "on",
contour = "off",
contour_label = "off",
contour_level_selection_type = "level_list",
contour_max_level = 1000.,
contour_min_level = 0.,
contour_level_list = [0,0.001,0.002,0.003,0.004,0.005,0.006,0.007,0.008,0.009,0.01],
contour_shade = "on",
contour_shade_colour_method = "palette",
contour_shade_method = "area_fill",
contour_shade_palette_name = "colorbrewer_ext_YlGn_10_r",
)
coast = mv.mcoast(
map_coastline_colour="charcoal",
map_coastline_resolution="medium",
map_coastline_land_shade="on",
map_coastline_land_shade_colour="beige",
map_coastline_sea_shade="on",
map_coastline_sea_shade_colour="RGB(0.8178,0.9234,0.9234)",
map_grid_colour="RGB(0.4,0.4,0.4)",
map_label_height=0.35,
)
title = mv.mtext(text_line_1="Normalised spread",text_font_size=1.2)
legend = mv.mlegend(legend_text_font_size=0.5,legend_title_font_size=1.0,legend_text_composition="user_text_only",legend_user_lines=["0","0.1%","0.2%","0.3%","0.4%","0.5%","0.6%","0.7%","0.8%","0.9%","1%"])
view = mv.geoview(coastlines=coast)
dw = mv.plot_superpage(pages=mv.mvl_regular_layout(view,1,1,1,1,[0,100,0,100]))
mv.setoutput(mv.png_output(output_name="spr_norm_t",output_name_first_page_number="off",output_width=1600))
mv.plot(dw,spr_t_norm,cont_spread,legend,title)
Version
Python 3.6.8, metview-python 1.14.0
Platform (OS and architecture)
Linux VDI (release 1.40)
Relevant log output
No log available (no error is produced).Accompanying data
/home/dalc/Public/ens_t.grib
Organisation
ECMWF
