Is it possible when using command line options to change the orientation of the page from landscape to portrait? Can the size of the page be altered too?
I'm creating plotted charts from BUFR observation data.
If you mean running Metview as 'metview -p' to plot your data then no, there are no options to control this. But if you're running from a Python (or Macro) script then you can adjust the page size and aspect ratio using the plot_superpage() function. You can incorporate this into a script that parses your own command-line parameters to control the layout. See:
4 Comments
Simon Keeling
Hi everyone,
Is it possible when using command line options to change the orientation of the page from landscape to portrait? Can the size of the page be altered too?
I'm creating plotted charts from BUFR observation data.
Many thanks,
Simon Keeling
Iain Russell
Hi Simon,
If you mean running Metview as 'metview -p' to plot your data then no, there are no options to control this. But if you're running from a Python (or Macro) script then you can adjust the page size and aspect ratio using the plot_superpage() function. You can incorporate this into a script that parses your own command-line parameters to control the layout. See:
Cheers,
Iain
Simon Keeling
Hi Iain,
Thanks so much for the pointer.
I'm not having much luck though. I've attached a section of the Python file I am using, can you spot anything in there I am doing incorrect?
The chart plots, but doesn't;t seem to take into account any of the page settings?
Thanks for any pointers,
Simon
# define observation plotting
obsp = mv.mobs(
obs_distance_apart = 0.6,
obs_size = 0.25,
obs_ring_size = 0.22,
obs_wind = "on",
obs_station_ring ="on",
)
# define page layout
pg = mv.plot_superpage(
layout_size = "a4",
layout_orientation = "portrait"
)
# define land-sea shading
coast = mv.mcoast(
map_coastline_land_shade = "off",
map_coastline_resolution = "high",
map_coastline_thickness = "1",
map_coastline_land_shade_colour = "grey",
map_coastline_sea_shade = "off",
map_coastline_sea_shade_colour = "RGB(0.7903,0.8438,0.943)",
map_grid_colour = "charcoal",
map_grid_longitude_increment = 10
)
# add title
title = mv.mtext(text_lines="SYNOP "+date.time_nosep+" "+date.true_date_sep, text_font_size=0.4)
# define map
view = mv.geoview(
map_projection="lambert",
map_area_definition = "corners",
area = [46.5,-15,61.5,13],
coastlines = coast
)
mv.setoutput(mv.pdf_output(output_name = '/Users/simonkeeling/Documents/MetView/synop_map'))
# generate plot
mv.plot_superpage(pg, view, bd, obsp, title)
Iain Russell
Hi Simon,
Could you create a ticket in the Support Portal so we can continue this there please?
https://confluence.ecmwf.int/category/sc
Cheers,
Iain