Plotting Data

Xmgrace

Creating the default settings for new graphs

Open xmgrace, make the desired changes to the various settings, save the file as ~/.grace/templates/Default.agr. A template appropriate for publication can be downloaded here. Note that in order to change the actual page dimensions, you need to go to View -> Page setup, and in the Page section, change Size to "Custom" and the Dimensions unit to be "in", put 3.25 x 3.25 (requirement for half-page figure) or 7 x 7 (for full-page figure). This will fix the size on the output devices (X11, PDF, PNG, or actual printers). The resolution on the computer screen (X11) is set in the Resolution (dpi) text box, and the resolutions for other types of devices are set in File -> Print setup -> Resolution (dpi). Unfortunately, the resolution setting and the default print device are not saved in the template file, but see below.

Setting the default printer to print to .png files with 300dpi

Create the file ~/.grace/gracerc.user and enter the following text:

HARDCOPY DEVICE "PNG"
DEVICE "X11" DPI 192
DEVICE "PNG" DPI 300
DEVICE "PDF" FONT ANTIALIASING on
DEVICE "EPS" FONT ANTIALIASING on
DEVICE "PostScript" FONT ANTIALIASING on

Special symbols

Italic, bold

italic: \1italic
bold: \2bold
italic and bold: \3xyz

Subscript, superscript

subscript: 3\s10\N
x-squared: x\S2\N

\N returns the font position to normal.

Special symbols

Angstrom symbol: \cE\C

For other characters, look at this list: ascii table with low and high characters. Just use the character from the left column between \c and \C to produce the one from the right column. I highlighted the most interesting characters (for a scientist).

Greek letters

theta: \xq\0
rho: \xr\0

\0 returns the font type to normal.

The \c, \C, and \x options are listed as deprecated in the xmgrace manual. The new method to insert special characters in xmgrace is:

  • Press ctrl-e while positioned in a text-edit field to bring up the font dialog box.
  • Select the desired font from the drop-down list. You probably want to use Symbol because it contains many of the commonly used special characters.
  • Click on the character you want to insert

This will put something like

\f{Symbol}q\f{}

into the text box.

Gnuplot

Ternary diagram

You basically need to calculate the (x,y) coordinates for all your data points as well as the three vertices of the triangle. This template file will produce something like this

Comments

Comments powered by Disqus