The purpose of this tutorial is to enable you to start making good quality scientific plots quickly. This will not cover everything - just some of the more important features.
When dealing with items in drop-down menus, we will use something of
the form
Things that are to be typed in will be presented in a typewriter font,
eg, type y = 3*sin(x).
xmgrace (data file)This is most useful if you are in the same directory as the data file and the columns you want to graph are the first two. If you don't enter a data file name, xmgrace will start up with an empty plot.
The browser will show some of the files in your current directory (the ones that are selected using the filter). Select the file you want and double click or hit return or click OK to bring it into the program. You should see a black curve drawn on a graph.
Block (Multi-column) Data:
When selecting the file, choose "Block data" from the "Load as" menu. If the read was successful, a window should pop up asking you to create a set from the block data. At the top it will list how many columns of data were read. First choose the type of set you would like. Choose the columns for the x- and y- coordinates using the drop down menus. The values Y1 through Y4 are used for selecting error bars as may be needed by other set types.
This lists all the datasets, and for the selected set, its type and a few statistics. To eliminate a set from the plot, select it and then press the right mouse button. A menu should appear from which you can select kill or kill data. The former totally eliminates everything associated with a set while the latter eliminates the data but keeps the settings for it so that if new data is read into the set, it will have the same properties like colouring and line width, etc.
Along the left-hand side is the ToolBar. It is armed with several buttons for commonly used Grace functions.
Draw: This will redraw the canvas and sets.
Useful if "Auto Redraw" has been deselected in the Edit/Preferences
dialog.
Lens: A zoom lens. Click on the lens, then select the
area of interest on the graph with the "rubber band". The region
enclosed by the rubber band will fill the entire graph.
AS: AutoScale. Autoscales the graph to contain all
data points of all visible (not hidden) sets.
Z/z: Zoom in/out by 5%. The zoom percentage can be
set in the Edit/Preferences dialog.
Arrows: Scroll active graph by 5% in the arrow's
direction. The scroll percentage can be set in the
Edit/Preferences dialog.
AutoT: AutoTick Axes. This will find the optimum
number of major and minor tick marks for both axes.
AutoO: Autoscale On set. Click the AutoO
button, then click on the graph near the set you wish to use for
determining the autoscale boundaries of the graph.
ZX,ZY: Zoom along an axis. These buttons work like the
zoom lens above but are restricted to a single axis. AX,AY: Autoscale the limits on one axis only.
Exit: ...To see the effect of a change, you have to hit the "Apply" button. In the Main menu:
This allows you to change the way points are graphed, including colour, line thickness, symbols, drop lines, fills, etc. When the window pops up, there will be a list of the sets with their number (eg. G0.S1 refers to set 1 in graph 0). To see the effect of a change, you have to hit the "Apply" button. In the Main menu:
We can now fill in the title of the graph and by clicking on the "Titles" tab, the font and size and colour can be chosen.
This allows you to create a set by applying an explicit formula to another set. All the classical mathematical functions are available (cos, sin, etc., but also more complex ones). All trigonometric functions use radians by default but you can specify a unit if you prefer to say cos (x rad) or sin (3 * y deg). For the full list of available numerical functions and operators, see Numerical operators and functions.
In the formula, you can use X, Y, Y1, ..., Y4 to denote any coordinate you like from the source set. An implicit loop will be used around your formula so if you say:
x = x - 4966.5
you will shift all points of your set 4966.5 units to the left.
You can use more than one set in the same formula, like this:
y = y - 0.653 * sin (x deg) + s2.y
which means you use both X and Y from the source set but also the Y coordinate of set 2. If you want to eliminate the old plot and replace it with a plot of the new modified X and Y coordinates, click on both the "Source" and "Destination" sets before you hit the apply button.
This saves the current plot parameters into a file so that you can produce the exact same graph without starting from scratch. If the current graph has not been saved already, you will be prompted for a name.
This saves the current plot parameters into a file - you will be prompted for a name.
This opens and graphs an earlier plot using the previously saved parameters.
This prepares to either print the graph on the printer, or produce a file for viewing.
This executes your wishes from the "Print setup" menu, printing to the printer using a Unix command or producing a file.
Arguments of both operators and functions can be either scalars or vector arrays. Arithmetic, logical, and comparison operators are given in tables below.
Another conditional operator is the "?:" (or ternary) operator, which operates as in C and many other languages.
(expr1) ? (expr2) : (expr3);
This expression evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.
|
|