Using xfig to create and update figures

There are a couple of pointers for using xfig that are not obvious from the manual pages, which will be briefly described here, including making and using clipart pages, and using xfig to mark-up Encapsulated PostScript files that you want to include as figures in documents.

Creating clipart for diagrams

If you make a bunch of icons or composite objects on a page and save that file, you now have a clipart file you load to make diagrams. This clipart can be to scale, so that you can make scale diagrams of racks and equipment, furnigure layout in rooms, etc. For example rack_clipart.fig is a collection of scale diagrams of racks, tapedrives, and machines used to make diagrams of system layouts by the UAS group.

You can create clipart or icons from a part of your diagram with xfig using the grouping mode, which is entered by clicking on the icon that looks like a picture of box around a circle, a box and letters in the "Editing Modes" area on the left of the screen and moving the mouse cursor back onto the figure area. You will see that the "Mouse buttons" description in the upper right corner now says that button 1 is "tag object", button 2 is "tag region", and button 3 is "compound tagged". The easy way to use this is to click button 2 above and to the left of your icon which starts a region, move to just below and to the left of the icon and click again to complete the region, and then press button 3 to "glue" those items together into a composite object. You can now move this composite as a single item, copy it, scale it, etc.

Using xfig to mark-up EPS files

To mark-up Encapsulated Postscript files with xfig, you need to start xfig, create an image box several layers deep containing the image, and then write over it at shallower layers to "mark it up". You can "white out" sections by drawing white, filled boxes, add arrows, circles, and text labels, etc. You can even add colored polygons at deeper levels to add color to black and white images, etc.

I have made an xfig file to make this easier; download the file markup.xfig and load it into xfig. Chose Edit mode ( a picture of a circle expanding to a popup labelled Edit) and click on the image box on the left hand side of the screen. Now you can change the name of the epsf file to one of your choosing, (or hit the Browse button to choose one), and click on Done to change it.

Using the Masking Tape

To use the Masking Tape strips, just copy them with in Copy ( a picture of a 2 blobs with an arrow between them labelled Copy) mode. You can also adjust their size (and the shape of the irregular piece) with the corner-mover mode ( a picture of before and after corners with an arrow between them) before copying them.

Adding annotations

You can add text, lines, arrows, etc. to the imgage now by simpy drawing lines, boxes, and text overtop of the image.

Saving the changed image

You can now save the image as another epsf image using the [Export...] popup, or you can save this xfig file using the [File...] popup.
You probably want to delete the Masking tape and the box around it before exporting the image.
When you export, don't forget to select Encapsulated PostScript as the file format.

If you want to create a file like markup.xfig, see the sections below.

Getting the image into xfig

To create the "deep" image box, click on the Picture Object icon (picture of box with flower and words Picture Object) and then click on the "Depth" control several times with your mouse button 3 to increase the depth to 5. Then click with button 1 to start a box, move the mouse until you have a box of a reasonable size, and click again to complete it. A popup will now appear which lets you fill in the name of the epsf file to include. Fill that in and press the [Done] button on the popup, and your image appears on the screen, inside the box you've drawn.

White-out for the image

To white-out areas on the image, I reccomend making a "masking-tape" box that you can copy onto the image to hide portions of it. Just make a box of depth 4, by first clicking on the rectangle icon, then click with button 2 on the Depth box to put the depth back up to 4, and use button 1 on the Fill Style, FillColor, and PenColor buttons to select solid filled, a white pen, and a white fill color. Now you can draw boxes (or polygons, or circles) that are white and obscure parts of the image.

When you're done, don't forget to put the depth up to zero or 1, and put the pen color back to black, etc.