After the imaging is done and the data are analysed, you are probably going to want to show off your lovely pictures in the form of a figure (for publication) or maybe a poster for a conference.
As with so many things in life, the first time is always the most nerve-racking, but fear not! Today we’re going to be walking through the basic tools you need to make Figures.
Part 1 will deal with the basics while Part 2 will focus more on importing data.
Some people may be familiar with Adobe Illustrator, Corel Draw or Microsoft Publisher as their software of choice for figures and while these are all great software, they don’t come cheap. Thankfully there is a multiplatform, Open Source Vector Graphics program available called Inkscape (I’m using version 0.91), which is perfect for what we need and won’t cost you a penny. So, if you want to play along, download and install it. Don’t worry, I’ll wait…
…all done? Great, let’s continue.
A Word to the Wise
Inkscape is awesome but it’s not perfect. It will occasionally crash (one that almost always does it for me it trying to drag an image from a web-browser directly into the program). So the very first thing you should do is turn on autosave. Do this through [ Edit > Preferences ] then navigate to Input/Output and Autosave. It’s worth remembering (or changing) where is the autosave directory in case you need to go back and rescue a file.
So Many Buttons
When you first open up Inkscape you may feel a little overwhelmed by the number of controls available. Don’t be! You’ll be using 3-4 tools at most. In fact you can immediately go to Edit > Show/Hide and turn off Commands, Snap Tools and Rulers. That should tidy the place up a bit. Throughout the guide, I’ll be referring to the Toolbar, Tools, Palette and maybe the Status bar so here’s what I mean:
Before we even think about putting images into our figure, let’s take a minute to think about layout. For the time being we can use placeholders to figure out how our figure panels (which will be populated in part 2) will be laid out.
Select the Rectangle tool (6th tool down) which is also accessible with F4 (you’ll find that there are shortcut keys for almost everything and that learning a few can really speed up your work!).
With that selected, you can see that the Toolbar now had Rectangle-specific properties, including the default colours for new objects. The colours of objects can be set by clicking on the palette at the bottom of the window (to set the fill) and clicking while holding down the Shift key (to set the stroke which is another name for the outline). Before drawing a rectangle pick a fill colour (in this case cyan), now you can draw a cyan rectangle on your page (it can be any size, we’ll change it later anyway).
We still have the Rectangle tool active. To interact with objects use the Select tool (the arrow at the top) available with F1. In select mode, you can drag to move the objects around and even resize by grabbing the arrows. A second click turns the arrows into rotate and skew handles. Holding down Shift and Control have different effects like maintaining aspect ratio while manipulating so have a play.
Note that these manipulations can also be controlled from the toolbar by entering values. Ignoring the X and Y positions for now, set the size to 200×200 pixels (px). This way, we know for sure that the panel is square.
I previously mentioned Fill and Stroke and this is an important concept for Objects. The terms are fairly self-explanatory, the stroke being the border around the object. To demonstrate, let’s set the stroke colour
With the rectangle selected, Shift-click a colour in the palette (for example red) to add a red stroke to the object.
To get more control of the colours (including setting the stroke weight) we need to open up the Fill And Stroke Dialog. You can do this with the keyboard shortcut Ctrl+Shift+f or via [ Object > Fill and Stroke… ]. From here the three tabs give you access to the colour, transparency (Alpha) and weight of the properties. If you need colour gradients you can also do that from here.
ASIDE: The reason we’re using filled boxes instead of outlines is because the stroke extends in and out from the edge of the fill (you can see this if you decrease the stroke opacity). This makes it harder to align things because it’s difficult to tell where is the edge of the object.
OK, back to the rectangle (or square if you’ve been playing along).
More Rectangles and Aligning
In this example, we’ll be making a four panel figure. Select the rectangle and copy it with Ctrl+c or [ Edit > Copy ]. If you use Ctrl-v to paste [ Edit > Paste ], the object will be pasted at your cursor. A useful alternative is Ctrl+Shift+v to Paste In Place [ Edit > Paste In Place ] which will drop the object in exactly the same place as the original.
What we really want is to align the squares into a nice grid. Open up our second dialog, the Align and Distribute with Ctrl+Shift+a [ Object > Align & Distribute ]. The first thing to do is to set the Align behaviour (the box preceded with Relative to: at the top). For most things I recommend using “First Selected”. With that done, select the top left square, hold down Shift and select the top Right Square (this selects both although as long as you hold down Shift, you can select as many as you want).
You can then use the Align tools to arrange the selected objects. Here, “Align Top Edges” makes sense. Note that because of the Align behaviour, the second square moves up in line with the first (not the other way around).
Using these tools, you can quickly align the squares in a nice grid so that all the spaces are even. Once aligned, you can drag a marquee selection around all 4 and drag them to the centre of the page.
Layering It On
The next thing we’ll do is add a figure title and some panel labels, but to keep things organised, we’ll put them in another Layer. Layers are easy to understand if you think about layering transparent sheets on top of each other (like tracing paper or acetate overheads).
First of all you need to open the Layers Dialog with Ctrl+Shift+L or via [ Layer > Layers… ]. Next, to keep things clear, right click on “Layer 1” and select rename. Call the layer “Masks”.
Now hit the plus sign to add another layer, call it “Labels” and place it above the current layer. The really useful thing about layers is that you can toggle visibility and editing for each later. Try clicking on the icons next to the layer names. Note that when a layer is locked, you can’t select the objects in the layer. Very useful.
OK, click on the Labels layer and then select the text tool (14th icon in Tools or use the shortcut F8). Something that takes a bit of getting used to is that text needs to be in a container. With the text tool selected, draw a text box at the bottom of your figure then type in your text.
Note the square handles on your text box. Your text can’t exceed the box but you can make the box bigger or smaller to fit. The text will also wrap to form multiple lines if it is too long for a single line. With the text tool selected you may have noticed that the toolbar changes to display a load of text-specific properties:
If you need to change something more specific, you may want the Text and Font dialog (can you guess the shortcut yet?) accessible with Ctrl+Shift+t or [ Text > Text and Font ].
Remember that as a vector graphics object, you can select the text (with the selection tool) and change it’s colour fill (the main thing you want to change for text) and stroke if you want some horrible 90s-looking wordart. You can also use the resize and rotate handles we mentioned earlier to transform text objects. A word of caution, when resizing text this way always hold down Control to scale uniformly otherwise your text will look very strange.
OK, on with the guide, add some panel labels to the figure (here I’ve used 48pt Arial, and have aligned the labels with the top left of the masks, then nudged them 4 units right and 4 units down using the arrow keys).
Getting it out!
Even at this early stage it’s nice to have an easily accessible version of your figures to help with drafting so you don’t have to open Inkscape every time you want to stare adoringly at your blue squares.
To do this open the export window (you guessed it… Ctrl + Shift + e or available on the menus as [ File > Export As PNG… ] ). There are only really 3 things you need to set:
- For figures you will almost always want to export the whole Page (select with the buttons at the top of the dialog). If you’re designing logos or graphics, you may want to use Selection.
- The spatial density measured in dots per inch (dpi) can be 90 for quick drafts but should be higher for printing or publication. Check with the journal but I usually export publication-grade figures at 300 or 600 dpi (this will however, make the file bigger).
- Path. Where do you want to save it?
Don’t forget to hit the Export button to save your image. Don’t forget that you’ll be exporting whatever is visible at the time so be sure to turn off visibility on your labels or masks (from the layers dialog) if you don’t want them in the exported file.
Not bad! In part 2 we’ll take this a step further, import some actual data and add in a second figure.