Difference between revisions of "Xmgrace"
(→Histogram) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 33: | Line 33: | ||
==Panel plots== | ==Panel plots== | ||
− | To plot a panel plot with xmgrace | + | To plot a panel plot with xmgrace use the following batchfile |
# make a panel plot | # make a panel plot | ||
Line 135: | Line 135: | ||
the command in the context of an example script: | the command in the context of an example script: | ||
+ | |||
cat << EOF > temp.bfile | cat << EOF > temp.bfile | ||
arrange (1,1,.1,.6,.6,ON,ON,ON) | arrange (1,1,.1,.6,.6,ON,ON,ON) | ||
Line 152: | Line 153: | ||
S0 legend "6 atoms restrained" | S0 legend "6 atoms restrained" | ||
legend 0.25, 0.8 | legend 0.25, 0.8 | ||
− | |||
AUTOSCALE | AUTOSCALE | ||
EOF | EOF | ||
Line 180: | Line 180: | ||
To put the Angstrom symbol in a label use the typesetting string (\cE\C). Other font info is at [http://lagash.dft.unipa.it/xmgr/fonts.html]. This also changes the font to Helvetica \f{Helvetica} and reduces the size \-. | To put the Angstrom symbol in a label use the typesetting string (\cE\C). Other font info is at [http://lagash.dft.unipa.it/xmgr/fonts.html]. This also changes the font to Helvetica \f{Helvetica} and reduces the size \-. | ||
yaxis label "\f{Helvetica}\-Ligand RMSD (\cE\C)" | yaxis label "\f{Helvetica}\-Ligand RMSD (\cE\C)" | ||
+ | |||
+ | To put greek symbols in the label, use the following: | ||
+ | yaxis label "\f{Symbol}a\f{}" | ||
+ | This will print "α" (alpha). Changing the letter "a" in the expression will change the symbol. For example: | ||
+ | "\f{Symbol}b\f{}" will print "β" (Beta), | ||
+ | "\f{Symbol}D\f{}" will print "Δ" (capital delta). | ||
+ | The "\f{}" in the end of the expression returns the font to the original. | ||
+ | |||
+ | |||
==Links== | ==Links== | ||
[http://plasma-gate.weizmann.ac.il/Grace/doc/UsersGuide.html xmgrace user's guide]<br> | [http://plasma-gate.weizmann.ac.il/Grace/doc/UsersGuide.html xmgrace user's guide]<br> | ||
[http://plasma-gate.weizmann.ac.il/Grace/doc/Tutorial.html xmgrace tutorial] | [http://plasma-gate.weizmann.ac.il/Grace/doc/Tutorial.html xmgrace tutorial] |
Latest revision as of 13:57, 23 July 2013
Sample Xmgrace input batch file
READ NXY "5M030.rmsd1.txt" READ NXY "5M030.rmsd2.txt" s0 line color 1 s1 line color 2 s0 legend "pose1 rmsd" s1 legend "pose2 rmsd" title "RMSD" xaxis label "time (ps)" yaxis label "RMSD (angstroms)" PRINT TO "${system}.eps" DEVICE "EPS" OP "level2" PRINT
Run Xmgrace with the command
xmgrace -batch temp.bfile -nosafe -hardcopy
where temp.bfile is the name of the batch file nosafe allows xmgrace to write the output eps plot hardcopy means make the plot and exit. Do not show gui.
For high resolution png file output with transperant background: The DEVICE "PNG" DPI dpi does not seem to change anything.
PRINT TO "output.png" HARDCOPY DEVICE "PNG" PAGE SIZE 2560, 2048 DEVICE "PNG" FONT ANTIALIASING on DEVICE "PNG" OP "transparent:on" DEVICE "PNG" OP "compression:9" PRINT
Contents
Panel plots
To plot a panel plot with xmgrace use the following batchfile
# make a panel plot arrange (2,1,.1,.6,.6,ON,ON,ON) # chose the first panel FOCUS G0 READ NXY "file1.txt" s0 line color 1 title "DMMGBSA_run 5M030-POSE1" xaxis label "time" yaxis label "DMMGBSA_run" yaxis tick major 5 yaxis tick minor 1 #chose the next panel FOCUS G1 READ NXY "file2.txt" READ NXY "file3.txt" s0 line color 1 s1 line color 2 s0 legend "pose1 rmsd"
Arrange existing graphs (or add extra if needed) to form an nrows by ncols matrix, leaving offset at each page edge with hgap and vgap relative horizontal and vertical spacings
ARRANGE(nrows, ncols, offset, hgap, vgap, hvinv, hinv, vinv)
Makes graph current and unhides it if necessary
FOCUS graph
Histogram
adjusting the placement of the label
The command for adjusting the placement of the label is as follows:
legend 0.25, 0.8
here the x-axis is 0.25 and y-axis is 0.8. where 1,1 is in the top right corner.
the command in the context of an example script:
cat << EOF > temp.bfile
arrange (1,1,.1,.6,.6,ON,ON,ON) FOCUS G0 READ NXY "temp1.txt" #range(0..10) with 101 bins of 0.1 each HISTOGRAM (S0, MESH(-60, -20, 101), OFF, OFF) # output histograms to files WRITE G0.S1 FILE "temp1.dat" # clear all data from program KILL G0.S0 KILL G0.S1 # reread data back in to get rid of formatting READ NXY "temp1.dat" #hides the NXY graph S0 line color 1 S0 legend "6 atoms restrained" legend 0.25, 0.8 AUTOSCALE
EOF
Running xmgrace
to view the image type the following in the command line
xmgrace -batch temp.bfile
to print to a file without viewing
gracebat -batch temp.bfile -nosafe -hardcopy -printfile "fig.png" -hdevice PNG
Save a state
You can manipulate your xmgrace plot with the GUI. After the graph looks the way you want it, you can save the project. After saving the state you can open the project file with a text editor and see the commands associated with that state. Then you can use the commands in a batch script and automate the creation of beautiful plots.
Axis labels
Manually position the yaxis label.
yaxis label "Ligand RMSD" yaxis label place spec yaxis label place 0.000000, 0.060000
Adjust the font size of yaxis label. Turn off the xaxis label.
yaxis ticklabel char size 0.800000 xaxis ticklabel off
To put the Angstrom symbol in a label use the typesetting string (\cE\C). Other font info is at [1]. This also changes the font to Helvetica \f{Helvetica} and reduces the size \-.
yaxis label "\f{Helvetica}\-Ligand RMSD (\cE\C)"
To put greek symbols in the label, use the following:
yaxis label "\f{Symbol}a\f{}"
This will print "α" (alpha). Changing the letter "a" in the expression will change the symbol. For example:
"\f{Symbol}b\f{}" will print "β" (Beta), "\f{Symbol}D\f{}" will print "Δ" (capital delta).
The "\f{}" in the end of the expression returns the font to the original.