📝 Publication Figures
Building Publication Figures
spy.build_publication_sounding() draws a clean, journal-style figure of one or more profiles: a skew-t, and
optionally a hodograph, a location map, and a table of parameters, sized for AMS and AGU journals and fitted so the
saved file is exactly the width you choose. It’s experimental in SounderPy 3.3.0. For a walkthrough with examples,
see 📝 Building Publication & Custom Figures.
- spy.build_publication_sounding(
- profiles,
- panels=('skewt', 'hodograph', 'parameters'),
- parameters=('mllcl', 'mlcape', 'mlcin', 'srh01', 'srh03', 'stp'),
- width='double',
- panel_labels=('(a)', '(b)', '(c)', '(d)'),
- colors=None,
- labels=None,
- storm_motion='right_moving',
- max_levels=250,
- ylim=None,
- parcel='ml',
- show_adiabats=False,
- show_barbs=True,
- hodo_heights=(0, 1000, 3000, 6000, 12000),
- hodo_max_height=12000,
- wind_units='m/s',
- hodo_limits=None,
- storm_motion_profile=0,
- sr_vector_heights=(),
- map_zoom=1.5,
- map_counties=True,
- map_radar=None,
- radar_time='sounding',
- parameter_profiles=None,
- style=None,
- watermark=None,
- dpi=300,
- save=False,
- filename='sounderpy_publication.pdf',
EXPERIMENTAL: a clean, journal-style figure of one or more profiles: a skew-t, and any of a hodograph, a location map, and a table of parameters, laid out for the panels asked for (see Publication Layouts).
- Parameters:
profiles (dict or list of dicts, required) – one SounderPy data dictionary, or a list of them, drawn in
colors.panels (tuple of str, optional, Default is
('skewt', 'hodograph', 'parameters').) –'skewt'and any of'hodograph','map'(each profile needssite-latlon), and'parameters', labeled in that order (see Publication Layouts).parameters (list or None, optional, Default is
('mllcl', 'mlcape', 'mlcin', 'srh01', 'srh03', 'stp').) – the parameter table’s columns (with the'parameters'panel): built-in names or(label, group, key, multiplier, unit, decimals)tuples. About 8 fit at the default width and font.width (str or float, optional, Default is
'double'(6.5 in).) –'single','double', a journal’s width (see Publication Widths), or inches.panel_labels (tuple of str, optional, Default is
('(a)', '(b)', '(c)', '(d)').) – labels for the panels, in the order skew-t, hodograph, map, and table, orNone.colors (list of str, optional, Default is
None(the style’s colors).) – a color for each profile.labels (list of str, optional, Default is
None(no legend).) – a legend name for each profile.storm_motion (str or list of floats, optional, Default is
'right_moving'.) – the storm motion for every profile’s parameters.max_levels (int, optional, Default is
250.) – the most vertical levels used from each profile.ylim (tuple, optional, Default is
None(1050 to 100 hPa).) – the skew-t’s pressure range as(bottom, top)in hPa.parcel (str or None, optional, Default is
'ml'.) – the parcel trace:'sb','ml','mu', orNone.show_adiabats (bool, optional, Default is
False.) – draw dry and moist adiabats.show_barbs (bool, optional, Default is
True.) – draw wind barb columns beside the skew-t.hodo_heights (tuple, optional, Default is
(0, 1000, 3000, 6000, 12000).) – heights (m AGL) to mark on the hodograph.hodo_max_height (int or float, optional, Default is
12000.) – where the hodograph stops (m AGL).wind_units (str, optional, Default is
'm/s'.) – the hodograph’s units:'m/s'or'kt'.hodo_limits (tuple, optional, Default is
None(fits the data).) – the hodograph’s limits as((u_min, u_max), (v_min, v_max)).storm_motion_profile (int or None, optional, Default is
0.) – which profile’s storm motion to draw, orNone.sr_vector_heights (tuple, optional, Default is
()(none).) – heights (m AGL) to draw storm-relative wind vectors to.map_zoom (float, optional, Default is
1.5.) – half the map’s shorter side, in degrees; it grows to fit every profile.map_counties (bool, optional, Default is
True.) – draw county lines on the map.map_radar (str or None, optional, Default is
None.) –'single','mosaic', orNone.radar_time (str, optional, Default is
'sounding'.) –'sounding'or'now'.parameter_profiles (list of int, optional, Default is
None(all).) – which profiles get a row in the table.style (dict, optional, Default is
None.) – changes toPUBLICATION_STYLEfor this figure.watermark (None, bool, or dict, optional, Default is
None.) –None,True, or watermark settings for this figure.dpi (int, optional, Default is
300.) – the figure’s resolution (dots per inch).save (bool, optional, Default is
False.) – save the figure tofilename.filename (str, optional, Default is
'sounderpy_publication.pdf'.) – the file to save to; its extension sets the format.
- Returns:
(fig, axes): the Matplotlib figure, and a dict of its panels ('skewt','hodograph','map','parameters', each when drawn).- Return type:
tuple
Example
import sounderpy as spy
raob = spy.get_obs_data('ABR', '2024', '08', '29', '00') # observed at Aberdeen, SD
ashley = spy.get_bufkit_data('hrrr', 'kasy', 3, '2024', '08', '28', '21') # HRRR forecast for Ashley, ND
fig, axes = spy.build_publication_sounding([raob, ashley], labels=['00Z ABR RAOB', 'HRRR F03 Ashley, ND'],
panels=('skewt', 'hodograph', 'map', 'parameters'),
parameters=('mllcl', 'mlcape', 'mlcin', 'mucape', 'srh01', 'srh03', 'bwd06', 'stp'), map_radar='single',
map_zoom=1)
fig.savefig('abr_kasy_20240829.pdf')
Publication Widths
width takes a name from PUBLICATION_WIDTHS, or inches:
|
Inches |
Fits |
|---|---|---|
|
3.2 |
one column in AMS and AGU journals |
|
6.5 |
two columns (full width) in AMS and AGU journals |
|
3.2 |
AMS, one column (19 picas) |
|
4.5 |
AMS, two-thirds of the page (27 picas) |
|
5.5 |
AMS, two columns (33 picas) |
|
6.5 |
AMS, full width (39 picas) |
|
3.35 |
AGU, one column (85 mm) |
|
6.7 |
AGU, two columns (170 mm) |
a number |
that many |
any width you need |
Every width uses the same layouts, scaled to fit, and the figure’s height follows from them. 'single' (3.2 in)
suits a skew-t alone; two or more panels need a two-column width, and a figure with a panel under 1.4 in across gives
a warning.
Publication Layouts
You choose the panels with panels; SounderPy places and sizes them. Each set of panels has its own predefined
layout, made to fill the figure: the skew-t, hodograph, and map each fill their space, whatever its shape (the
skew-t’s isotherms stay at 45°, and the hodograph keeps one unit the same length both ways), with room kept for the
skew-t’s wind barbs and the map’s radar colorbar. Panels are labeled in the order skew-t, hodograph, map, and table,
whatever order they’re listed in.
|
Layout |
|---|---|
|
the skew-t alone |
|
the skew-t beside the other panel, as tall as it is |
|
a wide skew-t over the table |
|
the skew-t beside the other panel, with the table across the bottom |
|
a tall skew-t beside the hodograph over the map |
|
a tall skew-t beside the hodograph over the map, with the table across the bottom |
The table is a strip with a column for each parameter, and the legend runs in one row across the bottom of the figure.
Every layout at the 'double' width, drawn at the same scale, with the HRRR’s and RAP’s 3-hour forecasts for
Aberdeen, SD, valid 00 UTC 29 August 2024.
Publication Parameters
parameters takes names from PUBLICATION_PARAMETERS:
Name |
Label |
Value |
Unit |
|---|---|---|---|
|
MLLCL |
mixed-layer LCL height |
km |
|
MLCAPE |
mixed-layer CAPE |
J kg-1 |
|
MLCIN |
mixed-layer CIN (negative) |
J kg-1 |
|
SBCAPE |
surface-based CAPE |
J kg-1 |
|
MUCAPE |
most-unstable CAPE |
J kg-1 |
|
MU SR-ECAPE |
most-unstable storm-relative entraining CAPE |
J kg-1 |
|
0–1 km SRH |
0–1 km storm-relative helicity |
m2 s-2 |
|
0–3 km SRH |
0–3 km storm-relative helicity |
m2 s-2 |
|
0–6 km BWD |
0–6 km bulk wind difference |
m s-1 |
|
STP |
effective-layer significant tornado parameter |
none |
|
SCP |
effective-layer supercell composite parameter |
none |
Any other value spy.sounding_params() calculates can be a column, given as a tuple of six items. Names and tuples
can be mixed in one list.
('0–3 km SBCAPE', 'thermo', 'sb3cape', 1, r'J kg$^{-1}$', 0)
# label group key multiplier unit decimals
label: the column’s name.
group and key: where the value is in
spy.sounding_params(clean_data).calc(). The groups are'general','thermo','kinem', and'intrp'; every value, by group and key, is listed on the Parameters & References page.multiplier: a unit conversion, such as
0.001for m to km, or0.514444for knots to m/s. Use1to keep the value as is.unit: the unit shown under the name; Matplotlib math text such as
r'm$^2$ s$^{-2}$'works.decimals: how many decimal places to show.
Publication Style
Every part of a publication figure’s look is a setting in PUBLICATION_STYLE. Change any of them for one figure
with style={...}, or for every figure in a script by changing PUBLICATION_STYLE itself
(from sounderpy.plot.publication import PUBLICATION_STYLE).
Setting |
Default |
What it sets |
|---|---|---|
|
|
the font, such as |
|
|
text size (pt); AMS and most AGU journals ask for about 8 pt, GRL for 6 pt |
|
|
the size of |
|
red, blue, black, orange, purple, green |
the profiles’ colors, in order |
|
|
temperature and dewpoint lines |
|
|
the parcel trace |
|
|
the skew-t’s temperature range (°C); also used when zoomed, if you set it |
|
|
isobars, isotherms, and adiabats |
|
|
axis lines and ticks |
|
|
wind barbs; the spacing is between profiles’ columns, in inches |
|
|
hodograph traces |
|
|
height markers and their labels (for GRL’s 6 pt, use |
|
see-through white |
the inside of each height marker |
|
|
the surface marker’s label, such as |
|
|
range rings on the hodograph |
|
|
the storm motion arrow |
|
|
storm-relative wind vectors |
|
|
the map’s lines and profile dots |
|
|
the radar colorbar, and its dBZ range |
|
|
the watermark’s text |
See Returned Figures & Panels for drawing on the returned panels, and 📝 Building Publication & Custom Figures for a walkthrough with examples.