HPGL — Plotter Language: From HP 7475A (1984) to Modern Cutters

2026-06-099 min read
HPGLplottervectorvintagecutter

HPGL (Hewlett-Packard Graphics Language) is a vector control language for pen plotters, developed by Hewlett-Packard in 1977 and publicly documented in 1984 with the release of the HP 7475A model. It is not an image file but a text stream of ASCII commands that the plotter interprets as carriage movements: "pen down", "draw line to X,Y", "pen up", "select pen number 2". Over forty years HPGL has survived the disappearance of pen plotters and become the standard for vinyl cutters, laser engravers, and small CNC routers. An OpenStreetMap quarter-mile map can be output to a 1984 HP 7475A or to a modern Roland cutting plotter — the command stream will be identical.

Map generation of Ekaterinburg city center
Ekaterinburg center, 200×200 m fragment. Building and road contours in HPGL are fed to the cutting plotter as a sequence of PA/PD/PU commands.

History: from the first pen plotter to the CNC router

In 1977 Hewlett-Packard released the HP 7220 — the first commercially successful pen plotter for offices. Driving it over RS-232 without a dedicated language was impossible, so HP engineers created HPGL — a compact syntax of two- and three-letter mnemonics: PA (Plot Absolute), PR (Plot Relative), PD (Pen Down), PU (Pen Up), SP (Select Pen). The language documentation became publicly available in 1984 with the HP 7475A — a desktop A3/A4 plotter with six pens. By 1990 HPGL was supported by nearly every major manufacturer: CalComp, Roland, Mutoh, Houston Instruments.

In 1990 HP released HPGL/2 — a language extension with polyline, fill, and font support. In parallel HP-GL/RTL (Raster Transfer Language) was added for sending raster data to A0 inkjet plotters. Most modern devices read both dialects, but compatibility between HPGL classic and HPGL/2 is not perfect: the SP command in HPGL/2 accepts additional pen thickness parameters that older plotters simply ignore.

With the arrival of laser and inkjet printing pen plotters nearly disappeared as a class, but the HPGL language migrated to two new niches. First — vinyl cutters and cutting plotters (Roland GX-24, Graphtec CE6000, Silhouette Cameo via drivers): the user needs a vector path along which a knife will travel, and HPGL is ideal for this. Second — the open CNC and laser engraving community: LightBurn, LaserGRBL, LinuxCNC accept HPGL as one of the standard input formats.

What's inside an HPGL file

HPGL is plain ASCII text, no binary wrapper, no header with size metadata or color profile. The command stream is separated by semicolons, optionally by line breaks. Minimal example:

IN;
SP1;
PA100,100;
PD;
PA500,100,500,500,100,500,100,100;
PU;
SP0;

Here IN (Initialize) resets plotter state. SP1 selects pen number 1 (the physical pencil in the first slot). PA100,100 moves the carriage to absolute coordinates (100, 100) with pen raised. PD (Pen Down) lowers the pen. The next PA with six coordinates draws a square: the carriage passes through four corners and returns to the start. PU raises the pen, SP0 returns the current pen to its slot.

Units are called plotter units. By specification 1 plotter unit = 0.025 mm = 40 units per millimeter. An A3 sheet of 297×420 mm is described by a coordinate grid of approximately 10,920×16,800 plotter units. This means positioning precision is one-quarter of one-tenth of a millimeter, well beyond pen plotter mechanical resolution (±0.1 mm) but matching modern cutters and routers exactly.

A street map in HPGL is a sequence of PA commands with two points (a segment) or one long PA with coordinates of all polyline vertices. Street-name labels are absent in classic HPGL — the LB (Label) command was only added in HPGL/2 and does not work on older plotters. In practice for map output it is customary to convert all text to vector outlines (outline-to-stroke) during preparation, so the only output is a set of PA/PD/PU primitives.

HPGL workflow: from OSM to plotter or cutter

Who needs HPGL: five roles

Vintage plotter operator. Collectors of HP 7475A, Roland DXY-880, Houston DMP-52 keep their machines working for architectural and engineering graphics. Modern software rarely offers HPGL directly — the standard path is to generate SVG or DXF in osm2cdr.ru, open in Inkscape, use the "Pen plotter output" extension (HPGL option), and save to .hpgl. The resulting text file is sent to the plotter's COM port via cat file.hpgl > /dev/ttyUSB0 or via the specialized Chiplotle software for Linux.

Vinyl cutter user. Roland GX-24, Graphtec CE6000-40, USCutter MH cutting plotters accept HPGL natively. A designer takes a district contour — for example the silhouette of Nevsky Avenue — and cuts a self-adhesive sticker from vinyl film. An HPGL map is limited to outlines without fills: the blade requires closed vector paths. At the osm2cdr.ru preparation stage this means exporting SVG with fills removed, or DXF with a single Buildings or Roads layer.

CNC engineer. Small CNC routers and laser engravers (Snapmaker, GRBL-based, K40 laser) accept HPGL as an alternative input alongside G-code and SVG. A street outline can be engraved into wood, acrylic, or anodized aluminum — yielding a souvenir or plaque. Geometric cleanliness matters here: intersections, duplicate segments, unclosed contours can cause the machine to traverse twice or skip portions.

Architect with HP DesignJet. HP DesignJet T120/T520/T1700 are modern A1/A0 inkjet plotters from Hewlett-Packard. They accept HPGL/2 (the extended dialect) as backward compatibility for legacy workflow. An architect opens a district plan of Moscow or Berlin from osm2cdr.ru, adds custom development in AutoCAD, exports via the HP DesignJet HPGL2 driver, and sends to print. On large formats this is still the standard path.

Collector-programmer. The plotterhead community (Twitter #plotterart) generates graphics algorithmically and outputs to pen plotters as an art form. An OpenStreetMap fragment drawn with a Rotring 0.13 pen on parchment is a popular subject. Here HPGL is the target generation format: the user writes Python or Processing scripts, builds PA/PD/PU strings, and saves .hpgl directly without an intermediate SVG.

Software for HPGL: six programs

Inkscape with Pen-Plotting extension. Free, GPL. Inkscape 1.3 ships with the "AxiDraw Pen Plotter" extension by Evil Mad Scientific, which can save any vector document to HPGL via File → Save As → HPGL. Sufficient for most tasks. inkscape.org

Chiplotle. Python library by Victor Adan and Douglas Repetto specifically for controlling HP plotters via RS-232. Not an editor but a programmatic API: generates HPGL from Python, sends to plotter via PySerial, includes a simulator. github.com/drepetto/chiplotle

HP-GL2 Viewer. A utility to preview HPGL files without sending to hardware. Opens .hpgl, displays the expected result, counts pen movements (important for mechanical wear on large maps). Several open-source implementations exist under "hpglview".

LightBurn. Paid (~$60), Windows/macOS/Linux. The dominant software standard for laser engravers. Accepts HPGL on input, converts to G-code for the laser. If a map is in HPGL — LightBurn opens it in one click, showing what will be cut versus engraved. lightburnsoftware.com

LaserGRBL. Free, Windows. A budget alternative to LightBurn for GRBL-based lasers. HPGL is supported via the interpreter, though raster features are weaker. lasergrbl.com

HPGL-tools (CLI). A bundle of command-line utilities: hpgl2svg, hpgl2dxf, hpgl2pdf. Useful for a one-step build script — for instance turning finished HPGL back into SVG for browser preview. Available via apt on Debian/Ubuntu, brew on macOS.

Map generation of Manhattan city center
Manhattan, 200×200 m fragment. For a laptop vinyl sticker, the contour export without fills works well.

Pitfalls and tips

HPGL classic vs HPGL/2. Older pen plotters (pre-1990) understand only the classic dialect: PA, PD, PU, SP, IN, IP, SC. Commands LB (Label), PT (Pen Thickness), PW (Pen Width), FT (Fill Type) are added in HPGL/2 and ignored by older hardware. If your plotter is older than 1990 — generate only classic commands. The Inkscape extension does this automatically when target is set to "HP 7475A".

Plotter units are not millimeters. The spec fixes 40 plotter units per millimeter (1 unit = 0.025 mm), but actual precision depends on the model. HP 7475A: ±0.1 mm mechanically; HP DesignJet: ±0.025 mm. Vinyl cutters: ±0.05 mm on paper, worse on thick materials. Compute source scaling with margin.

Pen-down / pen-up state machine. The plotter remembers pen state. A stray unclosed PD left in the file will cause the next PA to draw a random segment across the page — a classic hand-generation bug. Always end your stream with explicit PU and SP0.

No Z-coordinate. HPGL is strictly 2D. 3D scenes, depth text, multipart polygons collapse to flat contours. For 3D printing consider STL or OBJ.

No color and no raster. HPGL is vector only. Color is set by pen selection (SP command), physically — which pencil is in the plotter's slot. On cutters SP1, SP2, SP3 may switch blade pressure or other physical parameters — model-dependent. PNG backgrounds, raster underlays, gradients do not exist in HPGL.

File size. A district map of 50,000 segments in HPGL weighs 2–5 MB — plain text, each PA command adds 10–15 bytes. For very large maps (entire central Moscow) the file can grow to 50+ MB; gzip compression gives 5–10× savings, but the plotter does not speak gzip — compress only for archival.

How to make an HPGL map via osm2cdr.ru

Direct HPGL export is not yet in the standard osm2cdr.ru format list, but a reliable two-step path exists: get DXF or SVG from the OSM map, then convert to HPGL via the Inkscape extension.

Step 1. On osm2cdr.ru draw the needed quarter or district fragment. For a vinyl sticker 100×100 meters is enough; for a large engraved panel up to 500×500 m. Step 2. In the format dropdown choose DXF (for CAD precision) or SVG (for design flexibility) — both formats support clean outlines without raster backgrounds. Step 3. Download the file. Step 4. Open in Inkscape. Step 5. Remove unneeded layers — for a cutter only Buildings or only Roads typically remain. Step 6. File → Save As → choose "AxiDraw HPGL" or "HP-GL/2" format. Step 7. Send the file to the plotter via a serial port utility or the appropriate driver.

Alternative via DXF: open in LibreCAD or QCAD, use the built-in "HPGL" export (available in plugins), send the result to hardware.

Sources

← All articles