Inkscape Tutorial

Written November 2019

Slides from tutorial are here.

Concepts

Inkscape is a free vector graphics editor. It is incredibly useful for figure design and layout. In a sentence, this means that at its core, Inkscape is about manipulating objects, vectors, text, and curves, rather than pixels. There are good online resources for questions on specific tools and visual effects. This tutorial is meant to be a "quick start" guide for using Matlab or Python with Inkscape to make good quality scientific figures.

Inkscape's native file format is the SVG, which stands for Scalable Vector Graphics. Other "vector graphics" file formats include PDF, EPS, and AI (Adobe Illustrator). When importing one of these other file formats, it's good practice to convert to an SVG. Image formats like PNG, JPEG, GIF, TIFF, and others are just that – plain old grid-of-pixel images. Editing raw images like this can be done with Photoshop or Gimp. Photoshop is to Gimp as is Illustrator to Inkscape.

If on Linux or OSX, launching Inkscape will launch X11 or XQuartz in the background, which is just a non-native "windowing" application. Quitting Inkscape will leave X11 on in the background, but quitting X11 will kill Inkscape's host environment and destroy unsaved changes. You've been warned. Even on Mac, keyboard shortcuts in X11 use the CONTROL key instead of COMMAND, but should otherwise be familiar – CTRL+C, CTRL+V for copy-paste, CTRL+S for save, etc.

Importing and Exporting

Matlab and Python (specifically matplotlib) can export in PDF or SVG formats. All subsequent advice will assume Matlab since that's what I use. In theory, exporting figures to SVG should be preferred, but in practice, I find there are sometimes issues. Specifically, my experience is that text will not always import nicely as an SVG, but objects (e.g. points on a scatter plot) are not colored or grouped well in a PDF. That said, sometimes Matlab --> PDF --> Inkscape --> SVG just seems to work better, and is something to try if the SVG is misbehaving.

Resizing things can be tedious sometimes, so it's good practice to programmatically export figures already sized at least close to your desired final dimensions. With a Matlab figure go to File > Export Setup. 99% of the time I can get away with setting only the dimensions and font size before exporting, then doing the rest in Inkscape.

When a figure is opened in Inkscape, its components are grouped, often two levels deep for whatever reason. SHIFT+CTRL+G will ungroup things. Alternatively, double-clicking into an object will move your scope down into the group. Likewise, PDF and SVG files can be imported into Inkscape using CTRL+I. I strongly recommend using the "Poppler" importer for PDFs.

Exporting from Inkscape to PDF is as simple as "save as" (SHIFT+CTRL+S). Get in the habit of closing the window so you don't accidentally edit the PDF after exporting. The SVG should remain the "master" file. Warning: transparencies in PDFs will not print well, even if they look fine on a screen. There's probably a better workaround, but currently, I always export figures that have transparencies as PNGs (SHIFT+CTRL+E to bring up the PNG exporter window); 300dpi is generally plenty of resolution.

Common Commands

Here are some very useful commands and their keyboard shortcuts:

Lots of work is also done with the mouse, of course. For instance:

InkscapeTutorial (last edited 2020-01-16 16:27:33 by RichardLange)

MoinMoin Appliance - Powered by TurnKey Linux