← Back to all sparks
M

mapsf

ANALYTICS
Velocity0.0

Thematic cartography with R. Contribute to riatelab/mapsf development by creating an account on GitHub.

Thematic mapping in base R that finally got a theming system, then spent two years polishing legends.

cartographythematic-mapsspatialbase-graphicsr-package
Current state
mapsf produces thematic maps on R's base graphics device — choropleths, proportional symbols, typology maps, rasters, and their combinations, with legends, scale bars, north arrows, and insets as composable elements. Version 1.0.0 was the structural release, introducing a theming system that deprecated eight scattered styling arguments and adding mf_png() and mf_svg() export helpers plus alpha transparency across map types. The 1.1.x and 1.2.x line since then has been steady refinement: background and extent control on the drawing functions, decimal and thousands-separator control in legends, and label placement arguments.
Where it's heading
The package has been consolidating control into fewer, more consistent places. Legend handling moved out to the maplegend package in 0.8.0 and the per-element mf_legend_* functions were deprecated in favor of arguments on the map calls themselves; theming replaced ad-hoc style arguments in 1.0.0; and recent releases keep propagating the same argument vocabulary — bg, extent, leg_val_rnd, leg_val_dec, leg_val_big — across every function that should accept it. Determinism is a visible concern too, with 1.2.1 fixing a seed so mf_distr() point positions stop moving between runs.
Prediction
The recent releases are almost entirely argument-parity work across existing functions, so expect that to continue until the vocabulary is uniform rather than any new map type appearing.

Recent moves

  1. 1mo ago

    Label placement arguments and deterministic distribution plots

    mf_label() gains add, extent, and expandBB arguments, and custom legend positions work for the prop_typo type. The quieter fix seeds the vertical jitter in mf_distr() so the same data produces the same plot every time — the difference between a figure you can regenerate and one you have to save.

    View source ↗
  2. 2mo ago

    Background and extent control across the drawing functions

    Adds bg and extent arguments to mf_map(), mf_shadow(), and mf_graticule() plus bg for mf_raster(), so background color and plot extent are set where the map is drawn rather than beforehand. A long list of cleanups accompanies it, removing unused arguments and pushing the leg_val_rnd, leg_val_dec, and leg_val_big vocabulary into the grad type and mf_legend().

    View source ↗
  3. 7mo ago

    PNG resolution control and legend number formatting

    Adds a res argument to mf_png() for nominal resolution and leg_val_dec and leg_val_big for decimal and thousands separators wherever leg_val_rnd already applied. Also improves the heuristic for detecting lon/lat plots in mf_scale(), and ships a new pkgdown site.

    View source ↗
  4. 1y ago

    1.0.0 introduces theming and deprecates eight style arguments

    ⚡ SPARK

    The first major version replaces scattered per-call styling with a theming system, deprecating bg, fg, tab, pos, inner, line, cex, and font, and shipping a new default map style. Map elements redraw on device resize, alpha transparency reaches every map type, and mf_png() and mf_svg() make export a first-class operation.

    View source ↗
  5. 1y ago

    Pencil-sketch layers, ckmeans breaks, and border extraction

    Adds mf_get_pencil() for turning polygons into a hand-drawn-style layer, mf_get_borders() for extracting borders between contiguous polygons, and Q6 and ckmeans classification methods for mf_get_breaks(). Also fixes inset functions on split windows and warns when values fall outside choropleth class limits.

    View source ↗
  6. 2y ago

    Graticule label display fix

    A single fix improving label display management in mf_graticule(). Narrow enough that it is the entire release.

    View source ↗