Viewed 5k times. I use xmgrace to plot data sets and I would like to add two data sets together. So I have two files: data1 1 1 2 4 3 I start xmgrace with xmgrace data1 data2 Then I see both files plotted.
I know that this is extremely simple, but for some reason I don't understand how that works. PS: I know many other ways to reach my goal but I also want to be able to do it with xmgrace. Improve this question. Add a comment. Active Oldest Votes. This can easily be achieved using the feature Evaluate expression Improve this answer.
Here is the output after I made it look a little prettier :. Sathyam Sathyam 3 3 silver badges 15 15 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Features include a point-and-click graphical user interface, precise control of graph features, ….
Interactive Graphic and command-line 2D plotting software. Instructions for Use. To run type: xmgrace. Grace: Created by Russell Lewis. Brighton-based Detective Superintendent Roy Grace, a hard-working police officer who has given his life to the job. In , Linux Journaldescribed Xmgr an early name for Grace as one of the t…. Grace Holden - GraceMarty A dataset is a collection of points with x and y coordinates, up to four optional data values which, depending on the set type, can be displayed as error bars or like and one optional character string.
A set is a way of representing datasets. It consists of a pointer to a dataset plus a collection of parameters describing the visual appearance of the data like color, line dash pattern etc.
Set type of num. Regions are sections of the graph defined by the interior or exterior of a polygon, or a half plane defined by a line. Regions are used to restrict data transformations to a geometric area occupied by region.
Real Time Input refers to the ability Grace has to be fed in real time by an external program. The Grace process spawned by the driver program is a full featured Grace process: the user can interact using the GUI at the same time the program sends data and commands. The process will adapt itself to the incoming data rate.
Hotlinks are sources containing varying data. Grace can be instructed a file or a pipe is a hotlink in which case it will provide specific commands to refresh the data on a mouse click a later version will probably allow automatic refresh. Grace allows the user to choose between several output devices to produce its graphics.
The current list of supported devices is:. Grace can also be instructed to launch conversion programs automatically based on file name. In many cases, when Grace needs to access a file given with a relative pathname , it searches for the file along the following path:.
Grace can access external functions present in either system or third-party shared libraries or modules specially compiled for use with it.
The term dynamic refers to the possibility Grace has to open the library at run time to find the code of the external function, there is no need to recompile Grace itself the functions already compiled in Grace are "statically linked". There are two types of coordinates in Grace: the world coordinates and the viewport coordinates. Points of data sets are defined in the world coordinates. The viewport coordinates correspond to the image of the plot drawn on the canvas or printed on, say, PS output page.
The transformation converting the world coordinates into the viewport ones is determined by both the graph type and the axis scaling.
Actually, there is yet another level in the hierarchy of coordinates - the device coordinates. However, you as a user of Grace should not worry about the latter. The mapping between the viewport coordinates and the device coordinates is always set in such a way that the origin of the viewport corresponds to the left bottom corner of the device page, the smallest of the device dimensions corresponds to one unit in the viewport coordinates.
With respect to the user interface, there are three modes of operation that Grace can be invoked in. The full-featured GUI-based version is called xmgrace. A batch-printing version is called gracebat. A command-line interface mode is called grace. Usually, a single executable is called in all cases, with two of the three files being symbolic links to a "real" one. Form a set from the current block data set using the current set type from columns given in the argument.
Assume data file is in netCDF format. This option is present only if the netCDF support was compiled in. Assume the answer is yes to all requests - if the operation would overwrite a file, Grace will do so without prompting.
Run in the safe mode default - no file system modifications are allowd through the batch language. This will be where help files, auxiliary programs, and examples are located. If you are unable to find the location of this directory, contact your system administrator. Print command. If the variable is defined but is an empty string, "Print to file" will be selected as default. The shell command to run an HTML viewer for on-line browsing of the help documents.
Upon start-up, Grace loads its init file, gracerc. The file is searched for in the magic path see magic path ; once found, the rest of the path is ignored. It's recommended that in the gracerc file, one doesn't use statements which are part of a project file - such defaults, if needed, should be set in the default template see default template.
It's recommended that in the default template, one doesn't use statements which are NOT part of a project file - such defaults, if needed, should be set in the gracerc see init file.
If the rubber-banding for zooms and lines, etc. You'll need to derive the item's X resource name from the respective menu label, which is easily done following these rules: All non-alphanumeric characters are skipped Start with lower case; each new word if any continues from the capital letter Add the item's type to the end - "Menu" for pulldown menus, "Button" for menu buttons. Xresources file the file which is read when an X session starts; it could be.
Xdefaults ,. Xsession or some other file - ask your system administrator when in doubt. Similarly, it may be desirable to alter default filename patterns of file selection dialogs. The recipe for the dialog's name is like for menu buttons outlined above, with "Button" being replaced with "FSB". Whenever the user is expected to provide a filename, either for reading in or writing some data, a file selection dialog is popped up.
In addition to the standard entries the directory and file lists and the filter entry , there is a pulldown menu for quick directory change to predefined locations the current working directory, user's home directory and the file system root. Also, a "Set as cwd" button is there which allows to set any directory as you navigate through the directory tree as the current working directory cwd. Once defined, it can be used in any other file selection dialog to switch to that directory quickly. Various selectors are available in several popups.
They all display lists of objects graphs, sets, The operations are available from a popup menu that appears when pressing mouse button 3 on them.
Depending on the required functionality, they may allow multiple choices or not. The operations that can be performed on graphs through the graph selector's popup menu are: focus to hide show duplicate kill swap create new All this operations are not available in every instance of the selector. For example in the "read sets" popup only one graph can be selected at a time, and the swap operation is disabled. The operations that can be performed on sets through the set selector's popup menu are: hide show bring to front send to back duplicate kill kill data swap edit in spreadsheet see Spreadsheet data set editor in text editor create new by formula in spreadsheet see Spreadsheet data set editor in text editor from block data pack all sets selector operations view set comments show data-less show hidden select all unselect all invert selection update.
Double-clicking on a list entry will open the spreadsheet editor see Spreadsheet data set editor on the set data. When the pointer focus is on the canvas where the graph is drawn , there are some shortcuts to activate several actions.
They are:. A single click inside a graph switches focus to that graph. Along the left-hand side of the canvas if shown is the ToolBar. It is armed with several buttons to provide quick and easy access to the more commonly used Grace functions. Draw : This will redraw the canvas and sets.
Useful if "Auto Redraw" has been deselected in the Edit Preferences dialog or after executing commands directly from the Window Commands interpreter. 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. 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 one axis only. Reset the state of Grace as if it had just started one empty graph ranging from 0 to 1 along both axes.
If some work has been done and not yet saved, a warning popup is displayed to allow canceling the operation. Open an existing project file. A popup is displayed that allow to browse the file system. Save the current work in a project file, using the name that was used for the last open or save. If no name has been set i. Save the current work in a project file with a new name. A warning is displayed if a file with the same name already exists.
Abandon all modifications performed on the project since the last save. A confirmation popup is fired to allow the user canceling the operation. Set the properties of the printing device. Each device has its own set of specific options see Device-specific settings. According to the device, the output can be sent either directly to a printer or directed to a file. The global settings available for all devices are the sizing parameters. The size of the graph is fixed. Changing the 'Page' settings changes the size of the canvas underneath the graph.
Switching between portrait and landscape rotates the canvas. Make sure the canvas size is large enough to hold your graph. Otherwise you get a 'Printout truncated' warning. Exit from Grace. If some work has been done and not saved, a warning popup will be displayed to allow the user to cancel the operation. Using the data set popup, you can view the properties of datasets. This include its type, length, associated comment and some statistics min, max, mean, standard deviation.
A horizontal scrollbar at the bottom allows to get the two last properties, they are not displayed by default. Using the menu on the top of this dialog, you can manipulate existing sets or add new ones. Among the most important entries in the menu, are options to create or modify a set using the spreadsheet data set editor see Spreadsheet data set editor. The dialog presents an editable matrix of numbers, corresponding to the data set being edited.
The set type and hence, the number of data columns can be changed using the "Type:" selector. Clicking on a column label pops up a dialog allowing to adjust the column formatting. The selected rows can be deleted via the dialog's "Edit" menu. Another entry in this menu lets you add a row; the place of the new row is determined by the row containing a cell with the keyboard focus on. As well, just typing in an empty cell will add one or several rows filling the intermediate rows with zeros.
The set operations popup allows you to interact with sets as a whole. If you want to operate on the data ordering of the sets, you should use the data set operations popup from the Data menu. The popup allows you to select a source one set within one graph and a destination and perform some action upon them copy, move, swap.
This popup also give you a quick access to several graph and set selectors if you want to perform some other operation like hiding a graph or creating a new set from block data. This entry fires up a popup to lay out several graphs in a regular grid given by M rows and N columns. The graph selector at the top allows one to select a number of graphs the arrangement will operate on. If the number of selected graphs isn't equal to M times N , new graphs may be created or extra graphs killed if needed.
These options are controlled by the respective checkboxes below the graph selector. 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.
0コメント