Grace User's Guide (for Grace-5.1.22)

by the Grace Team

20.05.2008
This document explains the usage of Grace, a WYSIWYG 2D plotting tool for numerical data. (A German translation of this document, made by Tobias Brinkert, is available here: Grace Benutzerhandbuch.)

1. Introduction

2. Installation guide

3. Getting started

4. Guide to the graphical user interface

5. Command interpreter

6. Advanced topics

7. References


1. Introduction

1.1 What is Grace?

Grace is a WYSIWYG tool to make two-dimensional plots of numerical data. It runs under various (if not all) flavors of Unix with X11 and M*tif (LessTif or Motif). It also runs under VMS, OS/2, and Windows (95/98/NT/2000/XP). Its capabilities are roughly similar to GUI-based programs like Sigmaplot or Microcal Origin plus script-based tools like Gnuplot or Genplot. Its strength lies in the fact that it combines the convenience of a graphical user interface with the power of a scripting language which enables it to do sophisticated calculations or perform automated tasks.

Grace is derived from Xmgr (a.k.a. ACE/gr), originally written by Paul Turner.

From version number 4.00, the development was taken over by a team of volunteers under the coordination of Evgeny Stambulchik. You can get the newest information about Grace and download the latest version at the Grace home page.

When its copyright was changed to GPL, the name was changed to Grace, which stands for ``GRaphing, Advanced Computation and Exploration of data'' or ``Grace Revamps ACE/gr''. The first version of Grace available is named 5.0.0, while the last public version of Xmgr has the version number 4.1.2.

Paul still maintains and develops a non-public version of Xmgr for internal use.

1.2 Copyright statement

Copyright (©) 1991-1995 Paul J Turner, Portland, OR
Copyright (©) 1996-2007 Grace Development Team

Maintained by Evgeny Stambulchik


                         All Rights Reserved

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

For certain libraries required to build Grace (which are therefore even included in a suitable version) there may be different Copyright/License statements. Though their License may by chance match the one used for Grace, the Grace Copyright holders can not influence or change them.


Package License
cephes library Free
T1lib LGPL
Xbae BSD-like
Tab Widget BSD-like
Licenses

2. Installation guide

2.1 Installing from sources

  1. Configuration
  2. Compilation
  3. Testing
  4. Installation

2.2 Binary installation

  1. Getting pre-built packages
  2. Installation
  3. Running tests

2.3 Alternative packaging schemes (RPM, ...)

Not written yet...

3. Getting started

For a jump-in start, you can browse the demos ("Help/Examples" menu tree). These are ordinary Grace projects, so you can play with them and modify them. Also, read the Tutorial.

O.k. Here's a VERY quick introduction:

  1. Start the GUI version: xmgrace (return).
  2. Select/check the output medium and canvas size in File/Device Setup.
  3. If needed, set the graph size ('Viewport' in Plot/Graph Appearance).
  4. Load your data with Data/Import/ASCII. 'Load as': 'Single set' for two-column ASCII data, 'Block data' for multi-column ASCII data.
  5. Adjust the scales, axis labels and tick marks in Plot/Axis properties. Acknowledge all changes with 'Apply'.
  6. Adjust lines, symbols, legends in Plot/Set appearance.
  7. Adjust titles, plot frame and legend display in Plot/Graph Appearance.
  8. Data can be manipulated in Data/Transformations. To shift a data set by 20 to the left, e.g., in 'Evaluate Expression' select the same set on the left and the right, and say Formula: y=y-20. As you'll probably notice, Grace can do MUCH more than that. Explore at your leisure.
  9. When you like your plot, select File/Print. That's it!

3.1 General concepts

Project files

A project file contains all information necessary to restore a plot created by Grace, as well as some of preferences. Each plot is represented on a single page, but may have an unlimited number of graphs.You create a project file of your current graph with File/Save,Save as.

Parameter files

A parameter file contains the detailed settings of your project. It can be used to transfer these settings to a different plot/project. You generate a parameter file with File/Save menu entry selected from the "Plot/Graph appearance popup". You can load the settings contained in a parameter file with File/Open.

Input file formats

Grace understands several input files formats. The most basic one is ASCII text files containing space and comma separated columns of data. The data fields can be either numeric (Fortran 'd' and 'D' exponent markers are also supported) or alphanumeric (with or without quotes). Several calendar date formats are recognized automatically and you can specify your own reference for numeric date formats. Lines beginnig with "#" are ignored. Blank lines indicate new dataset. Grace also has a command language (see command interpreter), you can include commands in data files using lines having "@" as their first non-blank character, though this is not recommended. Depending on configuration, Grace can also read NetCDF files (see configuration).

Graphs

A graph consists of (every element is optional): a graph frame, axes, a title and a subtitle, a number of sets and additional annotative objects (time stamp string, text strings, lines, boxes and ellipses).

The graph type can be any of:

The idea of "XY Chart" is to plot bars (or symbols in general) of several sets side by side, assuming the abscissas of all the sets are the same (or subsets of the longest set).

Datasets

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.

Sets

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).

The set type can be any of the following:


Set type # of num. cols Description
XY 2 An X-Y scatter and/or line plot, plus (optionally) an annotated value
XYDX 3 Same as XY, but with error bars (either one- or two-sided) along X axis
XYDY 3 Same as XYDX, but error bars are along Y axis
XYDXDX 4 Same as XYDX, but left and right error bars are defined separately
XYDYDY 4 Same as XYDXDX, but error bars are along Y axis
XYDXDY 4 Same as XY, but with X and Y error bars (either one- or two-sided)
XYDXDXDYDY 6 Same as XYDXDY, but left/right and upper/lower error bars are defined separately
BAR 2 Same as XY, but vertical bars are used instead of symbols
BARDY 3 Same as BAR, but with error bars (either one- or two-sided) along Y axis
BARDYDY 4 Same as BARDY, but lower and upper error bars are defined separately
XYHILO 5 Hi/Low/Open/Close plot
XYZ 3 Same as XY; makes no sense unless the annotated value is Z
XYR 3 X, Y, Radius. Only allowed in Fixed graphs
XYSIZE 3 Same as XY, but symbol size is variable
XYCOLOR 3 X, Y, color index (of the symbol fill)
XYCOLPAT 4 X, Y, color index, pattern index (currently used for Pie charts only)
XYVMAP 4 Vector map
XYBOXPLOT 6 Box plot (X, median, upper/lower limit, upper/lower whisker)
Set types

Not all set types, however, can be plotted on any graph type. The following table summarizes it:


Set type XY Graph XY Chart Fixed Polar Pie
XY + + + + +
XYDX + - + - -
XYDY + + + - -
XYDXDX + - + - -
XYDYDY + + + - -
XYDXDY + - + - -
XYDXDXDYDY + - + - -
BAR + + + - -
BARDY + + - - -
BARDYDY + + - - -
XYHILO + - - - -
XYZ + - + + -
XYR - - + - -
XYSIZE + + + + -
XYCOLOR + + + + +
XYCOLPAT - - - - +
XYVMAP + - + - -
XYBOXPLOT + - - - -
Graph/Set type connection

Regions

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

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

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).

Devices

Grace allows the user to choose between several output devices to produce its graphics. The current list of supported devices is:

Note that Grace no longer supports GIF due to the copyright policy of Unisys. Grace can also be instructed to launch conversion programs automatically based on file name. As an example you can produce MIF (FrameMaker Interchange Format) or Java applets using pstoedit, or almost any image format using the netpbm suite (see the FAQ).

Magic path

In many cases, when Grace needs to access a file given with a relative pathname, it searches for the file along the following path: ./pathname:./.grace/pathname:~/.grace/pathname:$GRACE_HOME/pathname

Dynamic modules

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").

Coordinate frames

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. Oh, and the most important thing about the viewport -> device transformation is that it is homotetic, i.e. a square is guaranteed to remain a square, not a rectangle, a circle remains a circle (not an ellipse) etc.

3.2 Invocation

Operational mode

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.

Command line options

-autoscale x|y|xy

Override any parameter file settings

-barebones

Turn off all toolbars

-batch batch_file

Execute batch_file on start up (i.e., after all other options have been processed and the UI initialized)

-block block_data

Assume data file is block data

-bxy x:y:etc.

Form a set from the current block data set using the current set type from columns given in the argument

-datehint iso|european|us|days|seconds|nohint

Set the hint for dates analysis

-dpipe descriptor

Read data from descriptor (anonymous pipe) on startup

-fixed width height

Set canvas size fixed to width*height

-free

Use free page layout

-graph graph_number

Set the current graph number

-graphtype graph_type

Set the type of the current graph

-hardcopy

No interactive session, just print and quit

-hdevice hardcopy_device_name

Set default hardcopy device

-install

Install private colormap

-legend load

Turn the graph legend on

-log x|y|xy

Set the axis scaling of the current graph to logarithmic

-maxpath length

Set the maximal drawing path length

-mono

Run Grace in monochrome mode (affects the display only)

-netcdf file

Assume data file is in netCDF format. This option is present only if the netCDF support was compiled in

-netcdfxy X_var Y_var

If -netcdf was used previously, read from the netCDF file X_var Y_var variables and create a set. If X_var name is "null" then load the index of Y to X. This option is present only if the netCDF support was compiled in

-noask

Assume the answer is yes to all requests - if the operation would overwrite a file, Grace will do so without prompting

-noinstall

Don't use private colormap

-noprint

In batch mode, do not print

-nosafe

Disable safe mode

-nosigcatch

Don't catch signals

-npipe file

Read data from named pipe on startup

-nxy nxy_file

Assume data file is in X Y1 Y2 Y3 ... format

-param parameter_file

Load parameters from parameter_file to the current graph

-pexec parameter_string

Interpret string as a parameter setting

-pipe

Read data from stdin on startup

-printfile

file Save print output to file

-remove

Remove data file after read

-results results_file

Write results of some data manipulations to results_file

-rvideo

Exchange the color indices for black and white

-safe

Run in the safe mode (default) - no file system modifications are allowd through the batch language

-saveall save_file

Save all graphs to save_file

-seed seed_value

Integer seed for random number generator

-settype xy|xydx|...

Set the type of the next data file

-source disk|pipe

Source type of next data file

-timer delay

Set allowed time slice for real time inputs to delay ms

-timestamp

Add timestamp to plot

-version

Show the program version

-viewport xmin ymin xmax ymax

Set the viewport for the current graph

-wd directory

Set the working directory

-world xmin ymin xmax ymax

Set the world coordinates for the current graph

-usage|-help

This message

3.3 Customization

Environment variables

Init file

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).

Default template

Whenever a new project is started, Grace loads the default template, templates/Default.agr. 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 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).

X resources

The following Grace-specific X resource settings are supported:

It is also possible to customize menus by assigning key accelerators to any item.

You'll need to derive the item's X resource name from the respective menu label, which is easily done following these rules:

For example, in order to make Grace popup the Non-linear curve fitting by pressing Control+F, you would add the following two lines

XMgrace*transformationsMenu.nonLinearCurveFittingButton.acceleratorText: Ctrl+F
XMgrace*transformationsMenu.nonLinearCurveFittingButton.accelerator: Ctrl<Key>f

to your .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". E.g., to list all files in the "Open project" dialog ("File/Open..."), set the following resource:

XMgrace*openProjectFSB.pattern: *

4. Guide to the graphical user interface

4.1 GUI controls

This section describes interface controls - basic building blocks, used in many popups.

File selection dialogs

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.

List selectors

Various selectors are available in several popups. They all display lists of objects (graphs, sets, ...) and can be used to perform simple operations on these objects (copying, deleting, ...). 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 following shortcuts are enabled (if the result of an action would contradict the list's selection policy, this would be ignored):

Graph selector

The operations that can be performed on graphs through the graph selector's popup menu are:

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.

Double-clicking on a list entry will switch the focus to that graph.

Set selector

The operations that can be performed on sets through the set selector's popup menu are:

Double-clicking on a list entry will open the spreadsheet editor (see Spreadsheet data set editor) on the set data.

4.2 The main window

The canvas

Canvas hotkeys

When the pointer focus is on the canvas (where the graph is drawn), there are some shortcuts to activate several actions. They are:

Clicks and double clicks

A single click inside a graph switches focus to that graph. This is the default policy, but it can be changed from the "Edit/Preferences" popup.

Double clicking on parts of the canvas will invoke certain actions or raise some popups:

The double clicking actions can be enabled/disabled from the "Edit/Preferences" popup.

Toolbar buttons

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.

4.3 File menu

The file menu contains all entries related to the input/output features of Grace.

New

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

Open an existing project file. A popup is displayed that allow to browse the file system.

Save

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.e., if the project has been created from scratch) act as save as.

Save as

Save the current work in a project file with a new name. A popup allows to browse the file system and set the name, the format to use for saving data points (the default value is "%16.8g"), and a textual description of the project. A warning is displayed if a file with the same name already exists.

Revert to saved

Abandon all modifications performed on the project since the last save. A confirmation popup is fired to allow the user canceling the operation.

Print setup

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. If your canvas size cannot easily be changed because, for example, you want to print on letter size paper, you need to adjust the size of your graph ('Viewport' in Plot/Graph Appearance).

Print

Print the project using the current printer settings

Exit

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.

4.4 Edit menu

Data sets

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. Also note that if you find some columns are too narrow to show all significant digits, you can drag the vertical rules using Shift+Button 2.

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).

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. Clicking on the row labels toggles the respective row state (selected/unselected). 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).

To resize columns, drag the vertical rules using Shift+Button 2.

Set operations

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.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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, ..., a9 to denote the fit parameters (as an example you can say y = a0 * cos (a1 * x + a2)). You specify a tolerance, starting values and optional bounds and run several steps before loading the results.

The fit characteristics (number of parameters, formula, ...) can be saved in a file and retrieved as needed using the file menu of the popup.

In the "Advanced" tab, you can additionally apply a restriction to the set(s) to be fitted (thus ignoring points not satisfying the criteria), use one of preset weighting schemes or define your own (notice that "dY" in the preset "1/dY^2" one actually refers to the third column of the data set; use the "Custom" function if this doesn't make sense for your data set), and choose whether to load 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.

Correlation/covariance

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. The result is normalized so that abs(C(0)) = 1.

Digital filter

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.

Linear convolution

The convolution popup is used to ... convolve two sets. You only select the sets and apply.

Geometric transforms

You can rotate, scale or translate sets using the geometric transformations popup. You specify the characteristics of each transform and the application order.

Sample points

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.

Prune data

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.

Feature extraction

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.


Feature Description
Y minimum Minimum Y value of set
Y maximum Maximum Y value of set
Y average Average Y value of set
Y std. dev. Standard deviation of Y values
Y median Median Y value
X minimum Minimum X value of set
X maximum Maximum X value of set
X average Average X value of set
X std. dev. Standard deviation of X values
XTD> X minimum M if you want to perform some other operation like hiding a graph or creating a new set from block data.

Arrange graphs

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).

The rest of the controls of the dialog window deal with the matrix spacing: left/right/top/bottom page offsets (in the viewport coordinates) and relative inter-cell distances, vertical and horizontal. Next to each of the vertical/horizontal spacing spinboxes, a "Pack" checkbox is found. Enabling it effectively sets the respective inter-cell distance to zero and alter axis tickmark settings such that only bottom/left-most tickmarks are visible.

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).

Overlay graphs

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).

Autoscale

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.

Regions menu

Status

This small popup only displays the current state (type and whether it is active or not) of the existing regions.

Define

You can define a new region (or redefine an existing one), the allowed region types are:

  • Inside polygon
  • Outside polygon
  • Above line
  • Below line
  • Left of line
  • Right of line
  • In horizontal range
  • In vertical range
  • Out of horizontal range
  • Out of vertical range

A region can be either linked to the current graph only or to all graphs.

Clear

This kills a region.

Report on

This popup reports you which sets or points are inside or outside of a region.

Hot links

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.e., read data again) by clicking on the update button.

Currently, only simple XY sets can be used for hotlinks.

Set locator fixed point

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].

Clear locator fixed point

This entry is provided to remove a fixed point set before and use the default again: point [0, 0].

Locator props

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.

Preferences

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.

4.5 Data menu

Data set operations

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, ...) in ascending or descending order, reverse the order of the points, join several sets into one, split one set into several others of equal lengths, or drop a range of points from a set. 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-1.

Transformations menu

The transformations sub-menu gives you access to all data-mining features of Grace.

Evaluate expression

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, ...). As usual 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 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. 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.

Histograms

The histograms popup allows you to compute either standard or cumulative histograms from the Y coordinates of your data. Optionally, the histograms can be normalized to 1 (hence producing a PDF (Probability Distribution Function).

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).

Fourier transforms

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 Grace was configured with the FFTW library (see configuration), then the DFT and FFT buttons really perform the same transform (so there is no speed-up in using FFT in this case). If you want Grace can to use FFTW wisdom files, you should set several environment variables to name them.

Running averages

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.

Differences

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.

Seasonal differences

The seasonal differences popup is used to subtract data from a period to data of the preceding period (namely y[i] - y[i + period]). Beware that the period is entered in terms of index in the set and not in terms of abscissa!

Integration

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.

Interpolation/Splines

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.

Several interpolation methods can be used: linear, spline or Akima spline.

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.

The abscissas of the set being interpolated must form a strictly monotonic array.

Regression

The regression popup can be used to fit a set against polynomials or some specific functions (y=A*x^B, y=A*exp(B*x), y=A+B*ln(x) and y=1/(A+Bx)) for which a simple transformation of input data can be used to apply linear regression formulas.

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.

Non-linear fit

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 usin