Sunteți pe pagina 1din 7

Louic's weblog

Some xmgrace tips


Xmgrace is a very nice piece of software to create publication quality gures. Even
better is that it stores your data and graph layout options as plain text (which is
especially nice in combination with subversion or perl scripts).
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{}
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 eld 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 les with 300dpi:
create the le ~/.grace/gracerc.user and enter the following text:
HARDCOPY DEVICE "PNG"
DEVICE "PNG" DPI 300
Changing the denition of the default colors:
Just edit the lines that say
@map color 7 to (220, 220, 220), "grey"
in the saved le. Edit the default le (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
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
1 of 7 Sunday 14 October 2012 10:44 AM
post will become an interesting collection of tips that can be turned into a useful
"cheat sheet".
Comments 35
louic wrote:
Some comments on this post were lost because of a harddisk crash at my
previous hosting provider. My backup was not recent enough at the time of the
crash to include those comments.
I changed to a dierent provider now and will re-post the comments if I manage
to recover them.
Posted 17 Jun 2009 at 3:43 pm
1.
Miles wrote:
Thanks for the excellent tips! I believe that the Default.agr tip doesn't work
unless you put the le at the location ~/.grace/templates/Default.agr (or an
equivalent sub-path of grace's search path).
Posted 21 Sep 2009 at 8:07 am
2.
louic wrote:
Thanks for your comment Miles, you are right and I changed it in the text.
Posted 01 Dec 2009 at 12:54 pm
3.
Mac wrote:
Great tips!
I tried the save Default.agr tip, but I'm not allowed to save there under Ubuntu
. Any ideas how to make that work?
Posted 29 Jan 2010 at 12:57 pm
4.
louic wrote:
Hi Mac,
Did you try to save the le as ~/.grace/templates/Default.agr ?
Every user should have rights to save this le in his own home directory. It is
possible that you need to create the directory rst. If it already exists but you are
not allowed to write there, only the administrator of your computer can solve
that problem.
Good luck!
Posted 29 Jan 2010 at 1:09 pm
5.
Mac wrote: 6.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
2 of 7 Sunday 14 October 2012 10:44 AM
I am the administrator of my own computer, lol.
Thanks for the tips, I made a new directory .grace in my home and saved the le:
and it works! Thank you so much .
Posted 29 Jan 2010 at 1:17 pm
Dawit wrote:
I have a problem in xmgrace!! I want to use square roots to label my graph but I
dont know how to write it in the xmgrace. Please help me with this thing.
Thanks!!!
Posted 23 Jun 2010 at 1:30 pm
7.
louic wrote:
To make a square root symbol, use:
\f{Symbol}\f{}
The new way to add symbols in xmgrace is:
press Ctrl-E while you are in the text eld: this will bring up the font dialog box
-> select the Symbol font -> click the square root.
Thanks for reminding me that this information was missing from my weblog, I
will update the text.
Posted 23 Jun 2010 at 2:32 pm
8.
Dawit wrote:
Thank you very much. Now, it works very well and I will have some questions in
futures. Hopefully, you will assist me on this. Thanks again!!!
Posted 23 Jun 2010 at 2:58 pm
9.
pc wrote:
hello, how do i write \tilde{\sigma} ? i have not yet been able to gure that out.
please let me know.
Posted 26 Jul 2010 at 7:29 pm
10.
louic wrote:
Do you mean you want to write a tilde symbol followed by a sigma symbol?
\f{Symbol}~s\f{}
Posted 26 Jul 2010 at 11:07 pm
11.
Gilles wrote:
My old data sets used > as a set separator, which was accepted by xmgr.
The default set separator in Grace is &.
How can I make grace interpret > as a set separator?
Thanks
12.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
3 of 7 Sunday 14 October 2012 10:44 AM
Posted 30 Jul 2010 at 10:43 pm
louic wrote:
I don't know how to do that, but why don't you just search and replace > by & in
a text editor or with sed/perl/python or whatever tool you prefer?
Posted 30 Jul 2010 at 10:45 pm
13.
Gilles wrote:
Yes, this is an option I considered.
I have many les and programs (such as GMT) using > as a
separator, so I thought there may be a simple way to do it in xmgrace. But
editing the les is easy.
Thanks
G
Posted 05 Aug 2010 at 1:29 am
14.
abhijit wrote:
Thanks buddy
Posted 07 Aug 2010 at 10:28 am
15.
Snigdha wrote:
Hi Louic... Nice tips!!!
I have a question about set operation. I have two data sets and want to do make
a 3rd data set which is average of these two. Is it possible to do it in xmgrace?
Posted 13 Oct 2010 at 10:47 pm
16.
louic wrote:
Hi Snigdha,
It is indeed possible to take the average of two datasets in xmgrace, but not very
straightforward imho. Here goes:
- Open the "Set Appearance" dialog box
- Right click on the list of sets, and choose "create new" -> "by forumla"
- For the x-axis, enter the starting point (= minimum value of x), ending point (=
maximum value of x), and length (= number of data points). These values should
of course correspond to the two sets you want to average.
- After "X =", enter $t (but is should already be there)
- After "Y =", assuming you want to average the sets "s0" and "s1", enter
(s0.y+s1.y)/2
- There you are!
Posted 14 Oct 2010 at 10:16 am
17.
Snigdha wrote:
Thanks Louic... this was of great help...
18.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
4 of 7 Sunday 14 October 2012 10:44 AM
Posted 14 Oct 2010 at 8:08 pm
Jeerson wrote:
Thx for the tips!
A question: do you also have problems with grace in newer versions of linux? I'm
now using Kubuntu Natty and I just cannot any more select any text in grace (it's
just not copied to the buer or klipper).
Googling for it I only nd people with problems which seem related to fonts, no
one else mentions the selecting/copying problem...
Posted 19 Jun 2011 at 11:50 pm
19.
louic wrote:
I have not had this problem with Grace-5.1.22 under Gentoo Linux (running
Openbox 3), so I cannot help you with that. I hope someone else will be able to
give you advice.
Posted 20 Jun 2011 at 1:54 pm
20.
Nino R. Pereira wrote:
Ik had al bijna besloten om het gemiddelde van twee lijnen met een spreadsheet
te maken toen ik me herinnerde dat Google m'n vriend is, en ik jou pagina
vond. Hartelijk bedankt voor de tip.
Posted 21 Jun 2011 at 4:35 am
21.
vishal wrote:
Hi thanks for nice tips here,
can any one please help,Instead of average of two datasets in xmgrace, I have
1000 such data sets. Its not a good idea to type (s0.y ...s1000.y)/1000. Also I
thought to copy paste by writing (s0.y ...s1000.y)/1000 through some script but
-After "Y =" does not allow to paste
Is there any command method/or else by which I can do such thing in xmgrace??
thanks and regards;
thanks and regards
Posted 06 Jan 2012 at 1:16 pm
22.
louic wrote:
Hi Vishal,
The best advice I can give you is not to use xmgrace for this. It is a program for
making nice plots, but not for doing calculations. Although it is possible, you will
save yourself time and eort by using "the right tool for the right job".
Personally, I would use Python and Numpy to do this, but if the datasets are not
too large, a spreadsheet may be the easiest way. You may also want to have a
look at qtiplot.
23.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
5 of 7 Sunday 14 October 2012 10:44 AM
Posted 06 Jan 2012 at 1:30 pm
vishal wrote:
I read here https://lists.phy.duke.edu/pipermail/phy246/2006/000029.html
one has to write/print in bash or other terminal and then copy from terminal and
nally paste in xmgrace.
this is not working for number of lines..
regards;
Vishal
Posted 06 Jan 2012 at 1:30 pm
24.
vishal wrote:
thanks louic!!
Posted 06 Jan 2012 at 1:35 pm
25.
Bernard wrote:
Thanks for this info -- I couldn't remember how to invoke specic fonts (like
Courier-Bold).
The "deprecation" of the old method of inserting symbols is very annoying to me.
I generate many of my plots with batch (text) les, and any instructions that
involve using mouse-cicks obviously can't be batched.
Xmgrace gives lovely results, but it is the most incompletely documented
package I've ever encountered. Perhaps I've been leading a very sheltered life.
Posted 17 Jan 2012 at 10:46 pm
26.
Bernard wrote:
BTW, I think user pc (from 26 July 2010) who wanted to do "\tilde{\sigma}"
wanted to have the tilde *on top of* the sigma. This is a common enough
operation in TeX/LaTeX, but (I assume) impossible with Grace.
Posted 17 Jan 2012 at 11:07 pm
27.
louic wrote:
@Bernard: I agree that xmgrace is not very well documented, and unfortunately
not very intuitive (to me) either. I still use it though, it does indeed create nice
plots. And I think you are right about the sigma.
Thank you for your comments.
Posted 18 Jan 2012 at 1:27 am
28.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
6 of 7 Sunday 14 October 2012 10:44 AM
louic wrote:
I have not tried it yet, but it seems to be possible to use LaTeX in xmgrace, see
here: http://sica.ufpr.br/sux/post/tutorial/tutorial-002/
Posted 18 Jan 2012 at 2:37 am
29.
natt wrote:
thanks! very useful!
Posted 19 Feb 2012 at 5:25 pm
30.
Jan wrote:
Hi Louic,
very nice tips! Maybe you also have an idea of how to adjust the size of the "Set
Appearance" window? It does not t in my screen so that its bottm is out of view
and one cannot press the "apply" or "accept" buttons..
thx
Posted 02 Mar 2012 at 3:01 pm
31.
louic wrote:
Hi Jan,
I don't think you can change the size of the window, but under Linux you can
move any window with the mouse by holding down the Alt key. Just hold down Alt
and click and drag anywhere on the window, maybe in that way you can work
around the problem.
Posted 02 Mar 2012 at 4:07 pm
32.
guest wrote:
@Jan
try free form:
xmgrace -free
Posted 03 Apr 2012 at 10:29 pm
33.
louic wrote:
Thanks "guest", for your helpful comment. This indeed allows users to resize the
xmgrace dialog windows.
Posted 04 Apr 2012 at 10:52 am
34.
Pritam Kumar Jana wrote:
How to get the 'innity' symbol in xmgrace?
Posted 30 Aug 2012 at 6:43 pm
35.
Louic's weblog - Some xmgrace tips http://blog.louic.nl/?p=249
7 of 7 Sunday 14 October 2012 10:44 AM

S-ar putea să vă placă și