Wednesday, May 2, 2012

User-defined Colors in Grace

Last week, I was working on a manuscript with a collaborators. As we approached the final draft, we decided to make the "colors" in our figures consistent. Unfortunately, we used different programs to make our graphs, and "red" in program X is not the same shade of "red" in program Y.

Grace (the program I use) offers a choice of 16 standard colors, from the usual pull down menu.

However, it allows for endless fine-tuning.

Once you save your graph (as graph.agr), open it up in a text editor. The color-definitions are clustered in lines that look like:
@map color 0 to (255, 255, 255), "white"
@map color 1 to (0, 0, 0), "black"
@map color 2 to (255, 0, 0), "red"
Let us say, we were not happy with the shade of grey available (it does seem a little too light). Look for the line:
@map color 7 to (220, 220, 220), "grey"
and change it to something like:
@map color 7 to (100, 100, 100), "grey"
You can tweak all the other color definitions to suit your taste or requirements.

No comments: