Wednesday, June 24, 2009

How to: create an "inset plot" or subplots with Grace?

Grace is an amazing data-analysis/plotting software that I use all the time, to create "journal" or "presentation" quality pictures.

Gnuplot is my workhorse, Grace is what I use when I want to play polo.

Although it is limited to 2D plotting, the professional quality of the product, the ability to export to a bunch of different formats (eps in particular), and the fact that it is freely available under GPL, make it irresistible.

Every once in a while, I have to make plots with insets. Like the one shown here. Each time I have to do it, I spend 15 minutes figuring out how to do it, 10 minutes to do it, and 5 minute telling myself how I should write it down for next time. So here are step-by-step instructions.

Data -> Import -> ASCIIto open the "Grace:Read Sets" dialog box.

Read in data (here I read in three data sets), and clean up, as usual to create Graph 1, which is labeled G[0].

To create Graph 2, open the "Grace:Read Sets" dialog box again.

In the "Read to Graph" portion the "(+) G0" graph is selected by default.

Right click on the "(+) G0" to open up a menu.

Select "Create new"

Read in data that you want in this graph, as in step 2.

At this point everything looks muddled, since both the graphs are superimposed. Later on, you can use mouse to select the appropriate graph, but right now, since they are almost on top of each other we need a different strategy.

Go to "Plot -> Graph Appearence -> Viewport".

Adjust the min and max values until desirable.

Now go on, as before. Remember to check which graph is "active" before making any changes.

hi i try to plot 2 graph in 1 same as yours . I follow the steps but I thing i am doing something wrong because when I want to see the second plot mine is emty my data is not included. I am stuck in this point.

Dear Vale, over the past year or so, I've started using a very nice plotting program called "Veusz" instead of Grace. It feels much more modern, is very easy to learn, and you can do the sort of dataset creation you ask about (subtract two columns) inside very easily.