lmplot guide

Embedded gnuplot engine, deterministic native PNG rasterizer, DejaVu font mapping, stats and fit read-back loops, and the standard lmcode_std_v3 catalog for lmplot.

Overview

lmplot embeds the complete non-interactive gnuplot command engine, a custom C++ anti-aliased RGBA scanline rasterizer (lmpng.trm), stb_truetype and stb_image, four DejaVu TrueType font faces, and the lmcode-cpp runtime into a single executable. Because it has no external dependencies on X11, Cairo, Pango, libgd, or system fontconfig directories, the same script produces byte-identical PNG and SVG files across containers, CI servers, and workstations.

Native PNG terminal and embedded DejaVu fonts

In standard gnuplot builds, PNG output depends on external libgd or Cairo/Pango stacks whose font selection and hinting vary across operating systems. lmplot replaces those external drivers with a deterministic built-in driver registered under both png and pngcairo:

Generate-plot-read-back workflows and multi-host dashboards

Running in the browser (WebAssembly)

The browser build splits lmplot into a systems layer and an application layer. The systems layer is lmplot.wasm: the same gnuplot sources, patches, rasterizer, fonts, lmcode-cpp VM and Plot functions as the native binary, compiled once with Emscripten 7.0.0. The application layer is lmcode bytecode. A page or an app loads programs at run time, or ships them as assets, and the wasm host runs them without being rebuilt.

Standard lmcode_std_v3 library

Alongside context plot: Plot, lmplot embeds the pinned standard lmcode_std_v3 catalog (cpp/std/lmcode-std.schema.json, 206 canonical signatures) of string, encoding, math, collection (IntList, FloatList, StrList, IntMap, FloatMap, StrMap, stacks, queues, priority queues), JSON, template, file, and return-framing functions. The pinned catalog does not include the REST and CLI interfaces (RestGet, CliCommand, rest_serve and related functions) found in newer lmcode_std_v3 catalogs, so do not use them in lmplot blocks.