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 -> ASCII to 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.
Update: Consider using Veusz; it has a much more modern feel. I wrote about how to do inset plots with Veusz here.
26 comments:
This was really useful to me. I had always wondered how you get the two graphs not to lie on top of each other without having to use plots next to each other. Thanks alot
I am glad you found it useful.
Thank you for the post!
I spent (without success) several hours on the Grace examples trying to figure out how to get such graphs, but with this tip took only a few minutes to get it!
Thanks vct.
Thanks for the very useful instructions!
Thanks for posting such a useful grace tips :)
Thanks a lot for the post. it is really very helpful...
thanks ehesan and debashree
Thank you,
You are welcome Wasim
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.
can you get to step 8?
HI,
I can get untill step 8
thank you I sort it.
it is working if i put the same graph in 2 little graphs . what i do not do properly is when i have to put the data in the second graph.
Hi, as you seems to be an expert in Grace :-) and you tip also helped me. I was wondering if you know any way to using latex symbols in Grace plots?
Extremely useful! This is the first piece of documentation on xmgrace that I actually found helpful. Thank you so much!
Thank you very much: this was one of the two problems of my day =)
maybe you know how to solve also the second one...I'll try to explain.
I have a file with 3 column: A,B,C and I want to plot with grace x=A and y=B-C.
Can I do it directly in grace without create the column D=B-C before?
Thanks,
Vale
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.
I think you'll be glad you made the switch.
Thanks sachin,
I'll take a look ;)
But when I know that a way exist for me it's impossible to change program and stop...I need to know how to use grace in such a way =D
I think the way is "evaluateExpression". I plotted B vs A and C vs A. So now I have "only" to unserstand which set source and destination highlight (mumble mumble mumble)
uouh, I did it!!!
You plot B vs A (S0 data set) and C vs A (S1 data set) then click on
data --> transformations --> evaluateExpression
As source set (on the left) select both S0 and S1 then in the space above put the formula
y=s0.y-s1.y
apply and on the plot now you have as third line the difference between the first two lines =)
It was really a stupid problem!
Thanks for your kind answer!
Vale
Hi,
I think I'm having the same problem as someone else did above. At Step 7, with G1 and my second xvg file highlighted I hit "ok" but the data loads into the G0 instead of G1.
Thanks this is useful.
Very useful and crisp. Thanks!
Thank you so much for sharing your knowledge, you are great!
Thanks a lot, this is very useful.
Post a Comment