Manual de xmgrace
You can use the bar on the left with Z and z to zoom in and out of your data. Autoscale As will autoscale to all non-hidden data sets. And when you import data you can choose whether or not to autoscale to XY, X-only, Y-only or not at all.
Finally, you can select regions horiz. This is handy for getting the derivative of only part of your curve e. Presenting it well. For publication ready graphs, a line thickness of at least 3 is recommended and symbols should be at least or larger. Clicking to the left or right of any sliderbar will automatically increment the size in units of I find this handy for getting precise size increases quickly. Increase the fonts on your axes to at least size font as well.
You can also change them to Helvetica or Helvetica-Bold for easier reading. Always be sure to label your axes, it will help in understanding your data later. Saving your data for next time. Also, note you can leave some information for yourself in Project description in case you forget about what you were working on when you look at this data months later.
I recommend you familiarize yourself with what this looks like by opening up one of your. Finally, if you settle on a style of grace that you like a lot, e.
Make a grace file called Defaults. Please email me if you have any additional questions not answered here! The Kulik group focuses on the development and application of new electronic structure methods and atomistic simulations tools in the broad area of catalysis. We are interested in transition metal chemistry, with applications from biological systems i.
A key focus of our group is to understand mechanistic features of complex catalysts and to facilitate and develop tools for computationally driven design. Skip to main content. Specifying the placement of the graph by entering the coordinates can be painful, especially the fine tuning.
To alleviate this problem, a graphical method is also available, although not readily apparent. After a legend appears, it may be dragged to a new location. To do this, press Ctrl-L with your mouse on the main canvas.
You should see the arrow cursor turn into a hand. If this doesn't work, double click on the main canvas to get its attention and then press Ctrl-L. Click on the legend and drag it. To cancel the legend drag mode as with all other modes , click on mouse button 3.
I got bored so I took the data files and produced my own, albeit ugly, graph. See if you can copy mygraph. A block of data is a table of number which are interpreted as columns of numbers. How sets are created from the columns depends on the information you want to extract from the file. We first need to read in a block of data. Select the file "3. 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.
Next we choose which column of data contains the x-ordinate. If there is no column, we can select "index" which will use the index into the column as the x ordinate starting from one. If you close this window, it can reopened by bringing up a set list eg. Try creating a new set of type XYdY. This is an XY curve with error bars.
Try X, Y, and Y1 the error from different columns. Besides reading in data files, Grace has an extensive scripting language with a large number of math functions built in, These function include the basic add, multiply, square root, etc, and also the cephes library of higher order math functions like Bessel functions and the gamma function.
Hence, functions in Grace are basically unlimited. See the user guide for more details. In addition, users can dynamically add libraries to Grace with any desired function. As well, points may be added manually to a set by the use of editors. To create a set, press mouse button 3 the rightmost one for right handed people anywhere within the data set list which may be empty and select Create new. A menu with 4 different ways of creating new sets will be presented. We'll go through them one by one.
Next, choose the type of set you would like to produce. This can be an extremely complicated function. Likewise, an expression for y is entered and for any other expressions that may be needed. Fields after y are labelled y1, y2, y3 and y4. For example, if the set type xydxdy is chosen, y1 will hold dx and y2 will hold dy and it will be necessary to enter expressions for them.
Pressing apply or accept will perform the calculations and create the new set. You may have to autoscale to see the new set. If your system has the Xbae widget set, this choice brings up a spreadsheet like editor to allow one to enter the points of the set by hand. Initially, it just has the point 0, 0. Clicking on add will insert a copy of the currently selected row immediately below the selected row. Clicking delete will delete the row which contains the cursor. This method is best suited to examining or modifying existing sets or creating very small sets.
The sets gets updated after one hits enter or leaves the cell. If your system doesn't have the Xbae widget set or you want the power of your favourite external editor, a text editor of your choice may be used to enter data. If the set is new, it will contain only the point 0,0. During editing, no other operations are possible. After the editor is closed, the set will be updated. Grace supports a large number of command line options which allow the user to control the appearance and placement of graphs.
This can be very useful if you want to use it to quickly print something without going through the GUI, use it within a script to automatically generate graphs, or have a plot come up already configured which can be much quicker than going through the GUI menus.
Invoking Grace with the command "grbatch"from the command line will cause Grace to start, produce a plot, send it to the printer unless a file is specified and then exit. In its simplest form, to produce a plot of the file a. If gracebat is unavailable on your system, the hardcopy option to xmgrace will do the same thing. Assuming the hardcopy device is a postscript printer, one could also type. Often, one wishes to plot several graphs with each graph having different characteristics.
This is easily accomplished from the command line. Options specified on the command line are parsed in order and stay in effect until overridden by specifying them again. The first step in plotting multiple graphs is usually telling Grace how many graphs we have and how to arrange them. The interpreter command "arrange" will do this. For example, if we want 4 graphs arranged in a simple 2x2 table, we specify -pexec "arrange 2, 2,. Specify any global options.
Specify for each graph, the data to plot and any options. Options should be specified in the following order: "-graph g" where g is the graph number starting at 0. This says to apply all following options to this graph. Set any autoscaling options. Remember, this setting is persistent. Set the set type. This is also a persistent setting. Specify the graph type and the input file. If reading in block data, create the sets with the "-bxy" option.
Specify any world scaling. It is important to do this AFTER sets are read unless autoscaling is off as the graph gets rescaled when data is read in. Specify anything else. Let's try an example. We will assume 5 plots, the first 4 of which are to be stacked vertically, and the fifth inset into the fourth. We wish to plot the files a. Assume a. This can be accomplished by. Note that the graph numbers start at 0 and that 0 is the default so it does not have to be specified for the first graph.
Undoubtedly, you will reach a point where you want to do something for which no command line option exists. We have been doing this with the arrange command.
This is where Grace's parameter file language is vital. The option "-pexec" will execute the next argument as if it had read it from a parameter file or excuted on the command line. If you want to do something more complicated than one command, you can use several pexec's or put the commands in a file and run the file with the "-batch" option.
To do the same as the previous example but also label the axes and recolour the curves, make a file called "bfile" with the Grace commands. Obligatory descriptive comment s0. This tutorial will explain some of Grace's curve fitting abilities. Grace can perform two types of fittings.
The first type is regression or linear fitting where optimization is done on a linear equation or an equation which can be expressed in a linear form. This includes fitting polynomials and certain forms of equations. The other type of fitting is nonlinear and allows for arbitrary user supplied functions. Let's take a curve and see how each type of fitting works. Select the set you just created Select the type of fit.
For now, pick Linear. We will load the fitted value for now. Press the accept button to see the results of the fit.
A window will pop up which will give you the results of the fit including the final expression. You might have to scroll back a bit to see it. See how high of a polynomial is needed to get an acceptable fit and try fitting other types of functions. Note that for the non-polynomial fits, A and B are the fitting parameters of the equation.
Now, we are not limited to computing our fitted curve at the points of the original function. Suppose these data are quarterly sales and we wish to predict our next quarter. Choose the type of fit which you found to work best. Instead of loading fitted values, Load: Function. Now the bottom of the widget will become active. We wish to extrapolate over the next quarter, so we would like to start at 0 and end at 4 and choose points. Press accept to see the extrapolation.
You may want to kill all the sets except the original function and the extrapolated function at this point. Begin by selecting the set to optimize, the original function. Next, we write a function of the form we wish to fit. The unknown parameters are labelled a You must start with a0 and work your way up.
Next we must specify that we have three parameters to fit which are a0, a1 and a2 and the tolerance of the solution. You must specify initial values for the parameters and put any bounds on them if necessary. Depending on the function you are optimizing, different initial conditions may lead to drastically different optima. The solution process is iterative and you must click on a button to run a certain number of iterations.
You should see the parameters change and a curve created with these parameters. In this example, the exact solution is reached within 5 steps. More parameters and more difficult functions may require more steps in which case you may choose to run 20 or or more steps. The newly created optimized curve should converge with an increasing number of steps. As in linear curve fitting, you can choose to load the fit function at the points of the original curve, over an arbitrary range or load the error at each point.
How does the true answer compare to your previous extrapolation? Fitting arbitrary curves can be a tricky business. Initial conditions are very important.
If you don't get a good fit, you may have to experiment a lot with the initial parameters values. Finally, note that the fitted curve does not get added until the accept button is pressed.
This allows you to "fool around" until you get a good fit without creating a lot of garbage sets. You can rotate sets around an arbitrary axis perpendicular to the canvas e. Also it is possible to scale sets and translate them. It is possible to perform operations between sets. The order in which the matrix is filled in with the graphs can be selected first horizontally then vertically or vise versa, with either of them inverted. Additionaly, one may choose to fill the matrix in the snake-like manner adjacent "strokes" are anti-parallel.
If you don't want the regular layout this arrangement gives you, you can change it afterwards using the mouse select a graph and double click on the focus marker, see clicks and double clicks. You can overlay a graph on top of another one.
The main use of this feature is to plot several curves using different scales on the same apparently graph.
The main difficulty is to be sure you operate on the graph you want at all times you can hide one for a moment if this becomes too difficult. Using this entry, you can autoscale one graph or all graphs according to the specified sets only. This is useful if you need either to have truly comparable graphs despite every one contains data of different ranges, or if you want to focus your attention on one set only while it is displayed with other data in a complex graph.
This small popup only displays the current state type and whether it is active or not of the existing regions. You can link a set to a file or a pipe using this feature.
Once a link has been established, you can update it i. After having selected this menu entry, you can select a point on a graph that will be used as the origin of the locator display just below the menu bar. The fixed point is taken into account only when the display type of the locator is set to [DX,DY].
This entry is provided to remove a fixed point set before and use the default again: point [0, 0]. The locator props popup allows you to customize the display of the locator, mainly its type and the format and precision of the display. You can use all the formats that are allowed in the graphs scales. The preferences popup allows you to set miscellaneous properties of your Grace session, such as GUI behavior, cursor type, date reading hint and reference date used for calendar conversions.
This popup gathers all operations that are related to the ordering of data points inside a set or between sets. If you want to operate on the sets as a whole, you should use the set operations popup from the Edit menu.
You can sort according to any coordinate X, Y, DX, The set selector of the popup shows the number of points in each set in square brackets like this: G0.
S0[63], the points are numbered from 0 to n Using evaluate expression allows you to create a set by applying an explicit formula to another set, or to parts of another set if you use regions restrictions. All the classical mathematical functions are available cos, sin, but also lgamma, j1, erf, For the full list of available numerical functions and operators, see Operators and functions. In the formula, you can use X, Y, Y1, An implicit loop will be used around your formula so if you say:.
Beware that the loop is a simple loop over the indices, all the sets you use in such an hybrid expression should therefore have the same number of points and point i of one set should really be related to point i of the other set. If your sets do not follow these requirements, you should first homogenize them using interpolation. The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data.
The bins can be either a linear mesh defined by its min, max, and length values, or a mesh formed by abscissas of another set in which case abscissas of the set must form a strictly monotonic array. This popup is devoted to direct and inverse Fourier transforms actually, what is computed is a power spectrum. The default is to perform a direct transform on unfiltered data and to produce a set with the index as abscissa and magnitude as ordinate.
You can filter the input data window through triangular, Hanning, Welch, Hamming, Blackman and Parzen filters. You can load magnitude, phase or coefficients and use either index, frequency or period as abscissas.
You can choose between direct and inverse Fourier transforms. If you specify real input data, X is assumed to be equally spaced and ignored; if you specify complex input data X is taken as the real part and Y as the imaginary part. If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.
The running average popup allows you to compute some values on a sliding window over your data. You choose both the value you need average, median, minimum, maximum, standard deviation and the length of the window and perform the operation.
You can restrict the operation to the points belonging to or outside of a region. The differences popup is used to compute approximations of the first derivative of a function with finite differences.
The only choice apart from the source set of course is the type of differences to use: forward, backward or centered. Beware that the period is entered in terms of index in the set and not in terms of abscissa! The integration popup is used to compute the integral of a set and optionally to load it. The numerical value of the integral is shown in the text field after computation.
Selecting "cumulative sum" in the choice item will create and load a new set with the integral and compute the end value, selecting "sum only" will only compute the end value. This popup is used to interpolate a set on an array of alternative X coordinates. This is mainly used before performing some complex operations between two sets with the evaluate expression popup. The sampling array can be either a linear mesh defined by its min, max, and length values, or a mesh formed by abscissas of another set.
Note that if the sampling mesh is not entirely within the source set X bounds, evaluation at the points beyond the bounds will be performed using interpolation parameters from the first or the last segment of the source set, which can be considered a primitive extrapolation. This behaviour can be disabled by checking the "Strict" option on the popup. You can load either the fitted values, the residuals or the function itself.
Choosing to load fitted values or residuals leads to a set of the same length and abscissas as the initial set. Choosing to load the function is almost similar to load the fitted values except that you choose yourself the boundaries and the number of points. This can be used for example to draw the curve outside of the data sample range or to produce an evenly spaced set from an irregular one.
The non linear fit popup can be used for functions outside of the simple regression methods scope. With this popup you provide the expression yourself using a0, a1, You specify a tolerance, starting values and optional bounds and run several steps before loading the results.
The fit characteristics number of parameters, formula, This popup can be used to compute autocorrelation of one set or cross correlation between two sets. You only select the set or sets and specify the maximum lag. A check box allows one to evaluate covariance instead of correlation. You can use a set as a weight to filter another set. Only the Y part and the length of the weighting set are important, the X part is ignored. You can rotate, scale or translate sets using the geometric transformations popup.
You specify the characteristics of each transform and the application order. This popup provides two sampling methods. The first one is to choose a starting point and a step, the second one is to select only the points that satisfy a boolean expression you specify.
This popup is devoted to reducing huge sets and then saving both computation time and disk space. The interpolation method can be applied only to ordered sets: it is based on the assumption that if a real point and an interpolation based on neighboring points are closer than a specified threshold, then the point is redundant and can be eliminated. The geometric methods circle, ellipse, rectangle can be applied to any set, they test each point in turn and keep only those that are not in the neighborhood of previous points.
Given a set of curves in a graph, extract a feature from each curve and use the values of the feature to provide the Y values for a new curve. For single exponential curves, this is 2. Read new sets of data in a graph. A graph selector is used to specify the graph where the data should go except when reading block data, which are copied to graphs later on.
Reading as "Single set" means that if the source contains only one column of numeric data, one set will be created using the indices from 1 to the total number of points as abscissas and read values as ordinates and that if the source contains more than one column of data, the first two numeric columns will be used. Reading as "NXY" means that the first numeric column will provide the abscissas and all remaining columns will provide the ordinates of several sets.
Reading as "Block data" means all column will be read and stored and that another popup will allow to select the abscissas and ordinates at will.
It should be noted that block data are stored as long as you do not override them by a new read. You can still retrieve data from a block long after having closed all popups, using the set selector. The set type can be one of the predefined set presentation types see sets. The data source can be selected as "Disk" or "Pipe". In the first case the text in the "Selection" field is considered to be a file name it can be automatically set by the file selector at the top of the popup. In the latter case the text is considered to be a command which is executed and should produce the data on its standard output.
On systems that allows is, the command can be a complete sequence of programs glued together with pipes. If the source contains date fields, they should be automatically detected. Several formats are recognized see appendix dates in grace.
Calendar dates are converted to numerical dates upon reading. The "Autoscale on read" menu controls whether, upon reading in new sets, which axes of the graph should be autoscaled. This entry exists only if Grace has been compiled with support for the NetCDF data format see configuration. Save data sets in a file. A set selector is used to specify the set to be saved.
The plot appearance popup let you set the time stamp properties and the background color of the page. The color is used outside of graphs and also on graphs were no specific background color is set. The time stamp is updated every time the project is modified. The graph appearance popup can be displayed from both the plot menu and by double-clicking on a legend, title, or subtitle of a graph see Clicks and double clicks.
The graph selector at the top allows to choose the graph you want to operate on, it also allows certain common actions through its popup menu see graph selector.
Most of the actions can also be performed using the "Edit" menu available from the popup menubar. The main tab includes the properties you will need more often title for example , and other tabs are used to fine tune some less frequently used options fonts, sizes, colors, placements.
If you need special characters or special formatting in your title or subtitle, you can use Grace escape sequences the sequence will appear verbatim in the text field but will be rendered on the graph , see typesetting.
If you don't remember the mapping between alphabetic characters and the glyph you need in some specific fonts mainly symbol and zapfdingbats , you can invoke the font tool from the text field by hitting CTRL-e.
You can change fonts and select characters from there, they will be copied back in the text field when you press the "Accept" button. Beware of the position of the cursor as you enter text or change font in the font tool, the character or command will be inserted at this position, not at the end of the string!
You can save graph appearance parameters or retrieve settings previously saved via the "File" menu of this popup. In the "Save parameters" dialog, you can choose to save settings either for the current graph only or for all graphs. The set appearance popup can be displayed from both the plot menu and by double-clicking anywhere in a graph see Clicks and double clicks. The set selector at the top allows to choose the set you want to operate on, it also allows certain common actions through its popup menu see set selector.
The main tab gathers the properties you will need more often line and symbol properties or legend string for example , and other tabs are used to fine tune some less frequently used options drop lines, fill properties, annotated values and error bars properties for example. You should note that despite the legend string related to one set is entered in the set appearance popup, this is not sufficient to display it. Displaying all legends is a graph level decision, so the toggle is in the main tab of the graph appearance popup.
If you need special characters or special formatting in your legend, you can use Grace escape sequences the sequence will appear verbatim in the text field but will be rendered on the graph , see typesetting.
The axis properties popup can be displayed from both the "Plot" menu and by double-clicking exactly on an axis see Clicks and double clicks. The pulldown menu at the top allows to select the axis you want to operate on. The "Active" toggle globally activates or deactivates the axis all GUI elements are insensitive for deactivated axes.
The start and stop fields depict the displayed range. Three types of scales are available: linear, logarithmic or reciprocal, and you can invert the axis which normally increases from left to right and from bottom to top.
The main tab includes the properties you will need more often axis label, tick spacing and format for example , and other tabs are used to fine tune some less frequently used options fonts, sizes, colors, placements, stagger, grid lines, special ticks, If you need special characters or special formatting in your label, you can use Grace escape sequences the sequence will appear verbatim in the text field but will be rendered on the graph , see typesetting.
Most of the controls in the dialog should be self-explanatory. One that is not and frequently missed is the "Axis transform" input field in the "Tick labels" tab. Entering there e. You can use any expression understood by the interpreter see command interpreter. Once you have set the options as you want, you can apply them. One useful feature is that you can set several axes at once with the bottom pulldown menu current axis, all axes current graph, current axis all graphs, all axes all graphs.
Beware that you always apply the properties of all tabs, not only the selected one. Set the properties of the display device. It is the same dialog as in Print setup. This menu item causes an update of all GUI controls.
Usually, everything is updated automatically, unless one makes modifications by entering commands in the Command tool. Command driven version of the interface to Grace. The command will be parsed and executed, and the command line is placed in the history list. Items in the history list can be recalled by simply clicking on them with the left mouse button.
For a reference on the Grace command interpreter, see Command interpreter. The console window displays errors and results of some numerical operations, e. The window is popped up automatically whenever an error occurs or new result messages appear. Click on any element of the interface to get context-sensitive help on it. Only partially implemented at the moment. A popup with basic info on the software, including some configuration details.
More details can be found when running Grace with the "-version" command line flag. The interpreter parses its input in a line-by-line manner. There may be several statements per line, separated by semicolon ;. The maximal line length is 4 kbytes hardcoded. The parser is case-insensitive and ignores lines beginning with the " " sign.
Name Description Examples expr Any numeric expression 1. Expression Description Types Example graph. SETS[1] graph. S nn set nn in graph graph nn : , graphsel graph G0. Variable Description datacolumn data column of current "active" set set. Variable Description vvariable[i] i-th element of a vector variable var user-defined variable Scalar variables. In numerical expressions, the infix format is used.
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 "? Function Description chdtr df, x chi-square distribution chdtrc v, x complemented Chi-square distribution chdtri df, y inverse of complemented Chi-square distribution erf x error function erfc x complement of error function fdtr df1, df2, x F distribution function fdtrc x complemented F distribution fdtri x inverse of complemented F distribution gdtr a, b, x gamma distribution function gdtrc a, b, x complemented gamma distribution function ndtr x Normal distribution function ndtri x inverse of Normal distribution function norm x gaussian density function pdtr k, m Poisson distribution pdtrc k, m complemented Poisson distribution pdtri k, y inverse Poisson distribution rnorm xbar,s pseudo random number distributed N xbar,s stdtr k, t Student's t distribution stdtri k, p functional inverse of Student's t distribution Statistical functions.
Methods of directly manipulating the data corresponding to the Data Transformation menu are described in table transformations.
0コメント