¿Qué hace geo-figure?
Produce figures that a geoscience journal will accept without a redraw request, and that a reader can understand without the caption.
Workflow
- Pin down the target before drawing. Ask (or infer from the manuscript) three things: the journal, the column width the figure will occupy, and the figure type (map, raster result, chart, multi-panel). Look up the width in
references/journal-specs.md. If the journal is unknown, default to Elsevier single column (90 mm) or double column (190 mm). - Inspect the data before styling it. Report CRS, extent, pixel size or feature count, value range, nodata value and units. A figure built on the wrong CRS or an unmasked nodata value is wrong no matter how it looks. Do not reproject or resample silently; say what you changed.
- Start from a template. Use
templates/geo_map.pyfor maps and raster results andtemplates/geo_chart.pyfor charts. Set the figure size in millimetres withfig_size_mm()so text prints at its real size. Useful helpers:plot_continuous_raster(),plot_categorical_raster(),plot_vector()(GeoDataFrames)add_scale_bar(),add_north_arrow(),add_locator_inset(),add_panel_label(),format_lonlat_ticks()time_series(),scatter_1to1(),grouped_bars()
- Draw. Apply the rules below.
- Check automatically. Run
check_figure(fig, target_width_mm). It flags a wrong width, text smaller than 6 pt and axes or colorbars without labels. Fix every issue it reports before saving. - Export. Use
save_figure(): vector PDF for line art and charts; PNG or TIFF at the required dpi for rasters and photos. Keep the PDF's text editable (the style sets embedded TrueType fonts). - Review and caption. Run the checklist at the end of this file and report each item as pass or fix. Draft a caption with
references/captions.mdand list any display-only processing for it.
Rules for every figure
- Size and text. Draw at final print width. Text 7–9 pt after printing, never below 6 pt. One font family across all panels (Arial/Helvetica or the journal's font).
- Colour. Perceptually uniform colormaps for continuous data (viridis, cividis, magma). Diverging colormaps (RdBu, BrBG) only when the data have a meaningful centre such as zero change, and centre them on it. Never use jet or rainbow. Categorical maps: at most about 8 classes, colour-blind-safe palette, and colours that follow convention (water blue, vegetation green, built-up red/grey).
- Units everywhere. Every axis and every colorbar has a label with units in parentheses, for example
NDVI (–),PM$_{2.5}$ (µg m$^{-3}$),Crevasse area (km$^2$). - Panels. Label sub-figures (a), (b), (c) in the top-left corner, consistent size and position. Share axes and colorbars when panels use the same variable and range; say so in the caption.
- No chartjunk. No 3D effects, shadows or background fills. Gridlines light grey and only when they help reading values.
Extra rules for maps
- Scale bar on every map. A north arrow when north is not up or the area is small enough that orientation is not obvious; omit it on global maps.
- Coordinates. Show a graticule or tick labels in degrees (e.g., 46.4°N, 8.0°E) or state the projected CRS in the caption (e.g., "UTM zone 32N, EPSG:32632").
- Study-area maps need a locator inset showing where the study area sits in the larger region.
- Rasters. Mask nodata to transparent, never to zero. Use
interpolation="nearest"for classified or segmentation maps so class edges are not blurred. - Basemaps and imagery. Credit the source in the figure or caption (e.g., "Imagery © Google", "Sentinel-2, ESA Copernicus"). Respect the licence; Google Street View and basemap tiles have terms of use.
Extra rules for charts
- Error bars, bands or boxes must say what they show (SD, SE, 95% CI, IQR) in the caption.
- Time axes use real dates, not indices. Mark gaps instead of drawing lines through missing data.
- Scatter plots that compare predictions with observations get a 1:1 line and report n, R² and RMSE with units.
- Accuracy results (OA, kappa, F1, IoU) are clearer as a table or a grouped bar chart than as a radar chart.
Integrity
Never invent, smooth or alter data to make a figure look better. If an outlier, artefact or missing value is visible, keep it and point it out to the user. Any processing done for display (stretching, clipping percentiles, resampling) must be stated so the user can put it in the caption or methods.
Final checklist (report pass/fix for each)
- Width matches the journal column; text ≥ 6 pt at print size (
check_figurepasses). - Resolution meets the journal minimum for the figure type (or the file is vector).
- Every axis and colorbar labelled with units.
- Colormap suits the data type and is colour-blind safe; no jet or rainbow.
- Maps: scale bar, coordinates or CRS, north arrow where needed, locator inset for study-area maps.
- Nodata masked; classified rasters use nearest-neighbour display.
- Panels labelled (a), (b), … consistently.
- Data and imagery sources credited.
- Display-only processing listed for the caption, and a draft caption provided.
Common requests
- "Make a study-area map": vector boundary with
plot_vector(), basemap or imagery if available, scale bar, north arrow, locator inset, CRS in the caption. - "Show my segmentation results": side-by-side panels of input image, reference labels and prediction with
plot_categorical_raster(), the same class colours in every panel and one shared legend. - "Compare model accuracy": a table first; if a chart is wanted,
grouped_bars()with the y-axis starting where differences stay honest and the range stated. - "Fix my figure for the journal": measure the current width and font sizes with
check_figure(), list what fails, then redraw at the correct size instead of scaling the image.