Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contour Map

Signature

sp.contour_map(title, lats=None, lons=None, field=None, *, variant="filled", bins=6, color_low=None, color_high=None, **kwargs) -> Chart

Aliases: sp.contour_map, sp.contourmap, sp.contour_map_chart, sp.geo_contour, sp.isarithmic_map, sp.scalar_field_map, sp.build_contour_map

Description

sp.contour_map() takes scattered lats/lons/field samples — not named regions — and interpolates them into a continuous surface draped over the world outline: temperature, pressure, precipitation, anything that varies smoothly across space rather than stopping at a border. Interpolation is real inverse-distance-weighting over a grid spanning the data’s own bounding box (padded, not the whole world), so the surface only ever describes the region actually sampled. bins controls how many discrete color bands (filled) or contour levels (isolines) the value range is split into.

Variants

Parameters


Returns

Chart — object with .html property and .show() method.


The default: the interpolated grid rendered as colored cells, a smooth heat-style drape from color_low to color_high across the sampled region — the fastest way to read where a field is high or low at a glance, without needing to trace individual lines.

Variant "filled"Aliases "filled" / "bands" / "heat" / "basic" / "default"Returns Chart
Preview

Real contour lines, not an approximation: genuine marching squares over the same interpolated grid, tracing bins threshold levels by linearly interpolating exactly where each grid cell’s edges cross the level — the same technique a real isobar or isotherm map uses, saddle cases included.

Variant "isolines"Aliases "isolines" / "lines" / "contour_lines" / "iso"Returns Chart
Preview