Some xmgrace tips

Xmgrace is a very nice piece of software to create publication quality figures. Even better is that it stores your data and graph layout options as plain text (which is especially nice in combination with subversion or scripts to edit your graph).

But some things are not very intuitive, which is why I keep a list of some useful possibilities below:

  • Subscript, superscript
    x-squared: x\S2\N
    subscript: 3\s10\N
  • Greek letters, example: theta
    \f{Symbol}q\f{} or shorter: \xq\0q to get a theta symbol followed by the letter q: \x switches to the Symbol font and \0 switches back to Times-Roman.
  • Special symbols, example: 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). The \c and \C option are listed as deprecated in the xmgrace manual., but what is the new way?. 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
  • Saving the default settings for new graphs:
    open xmgrace, make the desired settings, save them as:
    ~/.grace/templates/Default.agr
    Unfortunately, this does not save the "print" settings, 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 "PNG" DPI 300
  • Changing the definition of the default colors:
    Just edit the lines that say
    @map color 7 to (220, 220, 220), "grey"
    in the saved file. Edit the default file (see above) if you wish to use the new colors everywhere from now on.

See also the Grace users guide and the grace forums.

If you have more helpful hints, please post them in the comments, so that this blog post will become an interesting collection of tips that can be turned into a useful "cheat sheet".

This entry was posted in linux, science. Bookmark the permalink.

55 Responses to Some xmgrace tips

  1. louic says:

    Here is a step-by-step guide:

    - Go to [Data] -> [Transformations] -> [Evaluate expression]
    - Select the source set (on the left) and destination (on the right) (you can select the same source and destination to change the data, or right click on the destination and select duplicate to copy the original set first)
    - Type "y = y * 10" and click [Accept]
    - That's all!

  2. Sudhir Kumar says:

    Dear users,
    i have a problem as follows:
    there are different symbol sets are available to represent the data set on x y plot.
    I wold like to represent our each data point by horizontal line instead of circle, cross, star , triangle etc.
    thanks in anticipation
    sudhir

  3. kathy says:

    When it comes to printing png files, will it work on any file if I convert it to png format?

  4. FirstKaylene says:

    I have noticed you don't monetize your blog, don't waste your traffic, you can earn additional cash every month because
    you've got hi quality content. If you want to know how to
    make extra money, search for: Mrdalekjd methods for $$$

  5. Erna says:

    Fascinating tips, very nice sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *