PlotDevice

A Python-based graphics language for
designers, developers, and tinkerers

A Scriptable Graphics Factory

PlotDevice is a Macintosh application that lets you write Python scripts to generate 2D graphics using simple drawing commands.
   Under the hood, your code drives the system's Quartz imaging engine, giving your scripts the same graphical power as a full-fledged Cocoa app.

Your code can combine basic geometric shapes, typography, freeform Bézier curves, and a panoply of image formats. This omnivorousness makes PlotDevice ideal for both workaday tasks like image-processing as well as more exotic
uses ranging from procedural texture generation to data visualization.


Write once, export everywhere

PlotDevice is more than just an updated version of Logo. The graphics you create in the app can be exported to a variety of popular file-types.
   In fact, without changing a single line of code, a script can generate bitmaps (PNG, JPEG, HEIC, or TIFF) or scalable vector images (PDF or EPS). Whether you're designing for print or screen, PlotDevice speaks your language.

In addition to static images, your scripts can easily generate multi-frame animations. Movies can be exported as H.265-encoded QuickTimes, animated GIFs, and even PDF ‘flipbooks’.
   PlotDevice lets you focus on the design first and only worry about the production details as necessary.


Draw with code

The application gives you everything you need to start writing programs that draw to a virtual canvas. It features a text editor with syntax highlighting and tab completion plus a zoomable graphics viewer and a variety of export options.
   PlotDevice's simple but com­pre­hen­sive set of graphics commands will be familiar to users of similar graphics tools like NodeBox or Processing. And if you're new to programming, you'll find there's nothing better than being able to see the results of your code as you learn to think like a computer.


Iterate and Automate

The scripts you write in PlotDevice are useful even outside of the app. You can use the included command line tool to run scripts and export images from the Terminal. The graphics routines can be imported from your own external Python scripts using the PlotDevice module, leaving your code in the driver's seat.

PlotDevice also provides a form of graphics sneakernet using the clipboard. Within the app you can copy the graphical output as a PDF and paste it into the illustration program of your choice. This allows for semi-automated designs combining code-driven structure and handmade detailing.


Fully Documented

The PlotDevice Reference describes the ins and outs of the drawing commands and datatypes available to your scripts. The entries discuss each command's syntax and demonstrate their use.

Those looking for a more narrative walk through the API will want to dive into
the Tutorial – a short book describing the PlotDevice drawing model and how to use it efficiently and expressively.

Perhaps the best way to learn a new language is to look at sample code. The app comes with a slew of terrific scripts written by Tom De Smedt which are accessible from the “Examples” menu.


Examples

  1. AlbumArt
  2. BitBop
  3. CoffeeStains
  4. Logo
  5. Spider
  6. StarFun
  7. Transformer
  1. Copyrights
  2. NumberTunnel
  3. Octothorpes
  4. OrganicBall
  5. RandomFont
  6. RandomText
  1. Balls
  2. ColorGrid
  3. Foliage
  4. FormFunction
  5. Nauseating
  1. AutoText
  2. ImageGrid
  3. TextFromList
  1. Hypnoval
  2. Parade
  3. WishyWorm
  1. HowCurvesWork
  2. Hypercube
  3. MathSculpture
  4. TunnelEffect
  1. Avoider
  2. Drawing
  1. Clipping
  2. Feedback
  3. Sorting
  4. SwissCheese

Downloads

PlotDevice v1.0.0

47.8mb / 15 Jul 2022

The application requires a Macintosh running macOS 11 or newer. After down­loading the archive, place the app in your “Applications” folder.

Documentation

11.1mb

If you're on-the-go and would like a copy of the User Manual that doesn't require net connectivity, download this archive for a static version of the full docs.

Sample Code

41kb

The examples included with the app can also be downloaded separately and run using the module’s plotdevice command line tool.


Source Code

GitHub Repo

contributions welcome

PlotDevice is an ongoing work-in-progress and your help is appreciated. If you'd like to get involved, report a bug or (better still) send a pull request.

Python Module

pip install plotdevice

You don't need to work within the app to use its graphics capabilities. Install the module and import it from your scripts for the best of both worlds.

MIT License

free as in beer

PlotDevice is open source and we hope you'll make the most of it. Feel free to use it however you like, but please consider sharing your modifications.


Family Tree

This project is a fork of the NodeBox 1 application which was developed in the early oughts at the Experimental Media Research Group in Antwerp and derived from an early version of DrawBot. Its original goals were twofold: offering a powerful graphics tool for Pythonistas and providing a learning environment for budding programmers.

PlotDevice is an “existential refactor” of the NodeBox code, updating it to work with modern versions of Python and macOS and adding syntactic sugar as judiciously as possible. Its main code-level innovation is the use of the Python with statement to reversibly modify graphics state. Despite these changes, it maintains backward compatibility with all the original NodeBox commands.

Acknowledgements

PlotDevice is primarily the work of Christian Swinehart, with significant API-design contributions from Marcos Ojeda. Special thanks to Alexander Bohn, Anselm Levskaya, and Adam Suharja for beta testing and essential feedback. Authors of the earlier projects in the app's lineage include:

Alternatives

PlotDevice is hardly the only app of its kind. It differs from similar projects in its focus on automation, expressiveness, and export quality over rendering speed or interactivity. If these trade-offs don’t match your project's use case, you still have a number of terrific packages to choose from:

NodeBox

The original inspiration for this project, NodeBox has gone in an interesting, Max/MSP-like direction in recent years and is now growing toward a web based future incarnation.

NodeBox for OpenGL

A cross-platform implementation of the NodeBox API. Rendering is offloaded to the GPU for high-performance interactive graphics.

DrawBot

NodeBox was originally a fork of this app which
is currently enjoying a renaissance of active development. Its commands are similar to PlotDevice’s but hew closer to the underlying imaging model for a less “abstracted” experience.

Processing

Ben Fry & Casey Reas kicked off the current wave of programmatic-drawing environments with their release of Processing in 2001. In addition to being “the original”, it’s the most time-tested and has by far the largest community.