Notes

HP-GL, the language of pen plotters

On the left five lines of code in a monospace font: IN; SP1; PU0,0; PD4000,0,4000,4000,0,4000,0,0; PU;. On the right the square it draws, with its corners labelled 0,0, 4000,0, 4000,4000 and 0,4000, small red arrows showing the order of the sides, and a scale line reading 4,000 units = 10 cm.
Diagram by JAEV: the program from this note and the square it draws, 4,000 plotter units or 10 cm a side. Red arrows show the order of the sides. CC BY 4.0.

HP-GL (Hewlett-Packard Graphics Language) is the set of commands Hewlett-Packard's pen plotters understand: two letters, then numbers, sent to the plotter as plain text. HP began marketing its two-letter language under that name in 1977, with the 9872A plotter.1

A short program

IN;
SP1;
PU0,0;
PD4000,0,4000,4000,0,4000,0,0;
PU;

IN initialises the plotter. SP1 selects pen 1. PU (pen up) lifts the pen and moves it to the point given, here 0,0. PD (pen down) lowers the pen and draws to each pair of numbers in turn, so this one command draws four connected lines: a square. The last PU lifts the pen again. Each command ends with a semicolon or a line break, and the numbers must be separated by commas, not spaces.2

The numbers are plotter units. One unit is 0.025 mm, the smallest move the plotter can make, so 40 units make a millimetre and the square above is 10 cm across.3

PA (plot absolute) measures the coordinates that come after it from the plotter's origin, as above; PR (plot relative) measures them from where the pen is.2

A short HP-GL program, written at random, and what a plotter would draw from it. The line being drawn is shown in bold. Solid: pen down. Dashed: pen lifted and moved. The square is 4,000 units, 10 cm on paper. Simulation by JAEV, not a plotter driver and not output from a real machine. Code CC BY 4.0.

The plotters

The 9872A cost $4,200 in 1977. It held four pens; the 9872C of 1981 held eight.1

The 7470A of 1982 was smaller and cost $1,550. Earlier plotters held the paper still and moved the pen over it on a mechanical arm; the 7470A moved the paper instead. The HP Computer Museum calls it the world's first small-format paper-moving plotter. It held two pens and drew on A4.4

The 7475A followed in 1983 at $1,895. It had a carousel of six pens and took A4 and A3. In 1984, helped by the IBM PC and Lotus 1-2-3, it was the most profitable single product HP made. The HP Computer Museum calls it "the most popular pen plotter ever made"; it was not discontinued until 1994.5

HP-GL today

The command-line tool vpype can turn an SVG into HP-GL for vintage plotters, for example with vpype read input.svg write --device hp7475a output.hpgl. It has to be told the plotter and the paper size, because, as its documentation says, HP-GL coordinate systems "vary widely from plotter to plotter and even for different physical paper format".6

Olof Broström's Unverified Air at JAEV is stored as files for a pen plotter, in black, red and blue ink.7 The machines that came before HP-GL, and the artists who used them, are described in the notes on the CalComp 565 and the Zuse Graphomat Z64 and in JAEV's text on plotter art.

Sources

  1. HP 9872A Graphics Plotter. HP Computer Museum
    “Introduced: 1977”; “Original Price: $4200”; “The 9872A had four pens”, capped; “With the 9872A, HP began marketing its 2-letter mnemonic graphics language as HP-GL (Hewlett Packard Graphics Language).” HP-IB interface; the 9872C (1981) had eight pens.
  2. “HPGL commands”. Reference, PIC microcontroller archive (Hallikainen)
    IN, SP, PU, PD, PA, PR, CI, LB, VS, SC, IP; “All commands MUST be terminated by a semi-colon or a linefeed”; “Spaces can NOT be substituted for required commas”. A community reference.
  3. Inkscape bug report 548918, quoting HP manuals (7475A Interfacing and Programming Manual; HP-GL Programmer's Reference Manual, 1984; HP-GL/2 and HP RTL Reference Guide, 1996)
    “one plotter unit equals 0.025 mm (0.00098 in)”; “The plotter unit is the smallest possible addressable move”; “40 plotter-units = 1 mm”, “1016 plotter-units = 1 inch”.
  4. HP 7470A Graphics Plotter. HP Computer Museum
    “Introduced: 1982”, $1,550; “the world's first small format paper-moving plotter”; two pens, A4; HP-IB, RS-232-C and HP-IL.
  5. HP 7475A Graphics Plotter. HP Computer Museum
    “Introduced: 1983”, $1,895; six-pen carousel, A4 and A3; “In 1984, the 7475 was the most profitable single product within HP”; “The 7475 was the most popular pen plotter ever made”; obsoleted in 1994.
  6. “Cookbook”. vpype documentation
    “For vintage plotters, the write command is capable of generating HPGL code instead of SVG”; “HPGL coordinate systems vary widely from plotter to plotter and even for different physical paper format”; example: vpype read input.svg write --device hp7475a output.hpgl.
  7. Olof Broström, Unverified Air, 2026–2027. JAEV
    “Every drawing is shown here as an image and stored as a file for a pen plotter, in black, red and blue ink”.
Published
JAEV Notes, October 2026.
Use
Text CC BY 4.0. Free to use and quote with credit to JAEV and a link to this page. Images and quotations by others keep their own terms.
All texts as one file: archive.json
Cite
JAEV Notes, “HP-GL, the language of pen plotters”, jaev.gallery/notes/hp-gl/, 2026.
Corrections
Additions and corrections are welcome: info@jaev.gallery
Share

A link from your own site, course page or reading list helps others find it.
Follow
New notes by RSS · Instagram · Bluesky

JAEV is a daemon taking shape: machines, weights, room, brain.