While this library is meant for live control of pen plotters from p5.js, you may want to export your p5.js sketch as a static SVG file, so it can be plotted using the iDraw Control extension for Inkscape.
If you haven’t already installed Inkscape, you can do so here To control the plotter with Inkscape, you will need the iDraw Control extensions.
Download the iDraw software here.
Follow the included instructions to install the iDraw extensions in the Inkscape extensions folder
Once you restart, the iDraw Control extension should be accessible in the Extensions menu:

For a full rundown of the iDraw Control extension, look at this guide (pages 6-25)
I recommend using the p5.plotSVG library to export p5.js sketches as plottable SVG files for use in Inkscape.
You can download the library from the project repo, which also contains detailed instructions on its use, including some example sketches.
Once you’ve exported an SVG file using the p5.plotSVG library, it can be opened in Inkscape. Once opened in Inkscape, be sure to set the artboard size to match the plotter’s output size (typically A4):
![]()

You may choose to center your graphics on the page after this step. You can do this by selecting all the layers in the “Layers and Objects” panel, and then clicking and dragging any object to move the selection group.
Before plotting, open the iDraw Control extension from the extensions menu, and navigate to the Options tab. Open the “Config” submenu and, under “iDraw model”, select the option that matches your iDraw hardware (typically iDraw A4):

To plot, navigate to the “Plot” tab in the iDraw Control extension, and click “Apply”:

You also may choose to change some of the plotter settings, such as the plotting speed, from this extension.