Magic Plot Help
Magic Plot Help
5 User Guide
Alexander Levantovsky, 2011 Compiled from online help on May 29 MagicPlot.com
Contents
Overview.............................................................................7
System Requirements and First Launch.....................................................7 Where to get the Java Virtual Machine?.......................................................7 First Launch..................................................................................................7 Opening Projects on Double Click................................................................7 Portable Installation.....................................................................................8 Getting Started: Tables, Figures, Fit Plots and Undo...................................8 Undo/Redo and History................................................................................8 Where to start?............................................................................................9 Creating Figures and Fit Plots......................................................................9 Adding New Table to Existing Folder............................................................9 Enter Expressions in any Numeric Field.....................................................10 Importing Table from Text File (ASCII).....................................................10 Table Editing..........................................................................................11 Displaying Column Formulas in Table........................................................13 Fit Column Widths......................................................................................13 See Also.....................................................................................................13 Missing Values (NaN) in Tables and Calculations......................................13 NaN in MagicPlot Tables.............................................................................14 NaN in Expressions....................................................................................14 Creating a Copy of Table, Fit Plot, Folder or Figure...................................15 What Data are Plotted on the Copied Fit Plots and Figures........................15
Fitting Algorithm and Computational Formulas.........................................24 Weighting of Data Points Using Y Errors....................................................24 Iterations Stop Criteria...............................................................................25 Formulas....................................................................................................25 See Also.....................................................................................................27 Joining the Parameters of Fit Curves........................................................27 See Also.....................................................................................................29 Specifying Custom Fit Equation (Pro edition only)....................................29 Fit Parameters............................................................................................30 Adjusting Parameters with Mouse Wheel...................................................30 See Also.....................................................................................................31 Using Spline for Baseline Subtraction (Pro edition only)...........................31 Editing Spline.............................................................................................31 Fitting with Spline......................................................................................32 See Also.....................................................................................................33 Guessing Peaks (Pro edition only)............................................................33 Smoothing of Data and 2nd Derivative......................................................34 The Number of Peaks.................................................................................34 See Also.....................................................................................................34 Predefined Fit Curves Equations..............................................................35 See Also.....................................................................................................36 Creating x-y Table from Fit Curves...........................................................36
Data Processing................................................................37
Setting Column Formula..........................................................................37 Row Index..................................................................................................37 Rows Evaluation Order...............................................................................37 Using Table Data........................................................................................37 Auto Recalculation on Data Change...........................................................38 Formula Menu in Column Context Menu....................................................38 About "Argument is out of range at row #" Warning.................................39 See Also.....................................................................................................39 Integration (Pro edition only)..................................................................39 Baseline Correction....................................................................................40 Formula......................................................................................................40 See Also.....................................................................................................40 Differentiation (Pro edition only).............................................................40 Formula......................................................................................................41 See Also.....................................................................................................41 Fast Fourier Transform (FFT) (Pro edition only)........................................41 Formulas....................................................................................................42 Parameters.................................................................................................44 Histogram Calculation (Pro edition only)..................................................44 Binning Options..........................................................................................44 Auto Binning Criteria..................................................................................45 3
Preview Plot...............................................................................................45 Descriptive Statistics (Pro edition only)...................................................46 Statistical Functions in Column Formulas..................................................46 Calculating Integrals and Statistics (Pro) on Intervals using Fit Plot..........46 Managing Intervals.....................................................................................47 Relative Integrals Calculation....................................................................47 Formulas....................................................................................................47 See Also.....................................................................................................48 Transform X or Y Fit Plot Data (Pro edition only)......................................48 See Also.....................................................................................................48 Formula Syntax.......................................................................................48 General Rules.............................................................................................49 Functions....................................................................................................49 Boolean Logic.............................................................................................50 Operators...................................................................................................51 Table Sorting..........................................................................................52 Sorting Criteria...........................................................................................53
Editing Figures..................................................................59
Adding and Arranging Axes on Figure......................................................59 Add and Arrange Axes as Table.................................................................60 Adding and Arranging Curves on Figure Axes...........................................60 Changing Curves Drawing Order................................................................60 Shifting Curves on Figure and Creating 2D Waterfall................................61 Using Figure Templates...........................................................................63 Saving Template from Figure.....................................................................63 Applying Template to a Figure...................................................................63
Tools..................................................................................78
MagicPlot Calculator...............................................................................78 Using the Calculator...................................................................................78 Standalone Calculator Application.............................................................78 5
See Also.....................................................................................................79
Appendices........................................................................80
Portable Installation on USB drive...........................................................80 MagicPlot Editions Comparison................................................................80 Keyboard Shortcuts................................................................................82 Common Shortcuts.....................................................................................83 Table Shortcuts..........................................................................................83 Figure and Fit Plot Shortcuts......................................................................83
Overview
System Requirements and First Launch
MagicPlot is a cross-platform application based on Java technology. You need to install Java software (Java Runtime Environment, also referred to as the Java Runtime, Runtime Environment, Runtime, JRE, Java Virtual Machine, Virtual Machine, Java VM, JVM, VM) with version not older than 6. Java 6 is also referred to as Java 1.6.
First Launch
MagicPlot does not need any installation procedure. Place MagicPlot executable file to directory you prefer. MagicPlot preferences and registration data are stored in your operating system profile and are individual for each account.
Mac OS X MagicPlot project files (.mppz) will MagicPlot by your operating system. be automatically associated with
Portable Installation
MagicPlot can be installed on USB-drive. See Portable Installation on USB drive for details.
Project tree Typically, you need to open, edit, process, plot and fit multiple data acquired in various experiments or series of experiments within single project. Ordinarily you have the source (imported) Table and a number of Tables with derivative data, such as Fourier transform or statistics of source Table data. MagicPlot automatically creates a new Folder every time you import new Table. All derivative data is stored in the same Folder by default. All Plots created from Tables in certain Folder are stored in the same Folder. Close Unused Internal Windows Feel free to close currently unused interval windows with Tables, Figures and Fit Plots. The data will not be deleted, the window will be closed only. You can open the closed window by double clicking on component in Project tree.
window. History dialog supports multiple undo and redo. Undone actions are marked light gray. Last saved state is set off in bold.
History dialog
Where to start?
In most cases you may start with importing table from text file by clicking Project Import Text Table menu item.
10
Table Editing
In MagicPlot Table is used to store numeric data. All tables use floating-point numbers in IEEE 754 double precision format. Empty cells are equivalent to Not-a-Number values. Table Context Menu Many table editing functions are available in table context menu (right click to open).
11
Table context menu Columns Numbers Columns are enumerated starting with 1. The first 26 columns are additionally denoted with Latin letters: A, B, C, Y, Z, 27, 28, 29, . You can use either numbers or letters, addressing cells and columns in formulas. Renaming Columns Double click on column header to rename table column. You can also use Rename Column context menu item or press F4. Moving (Reordering) Columns Hold Alt key (Option on Mac, Meta/Win on Unix-like) and drag column header to rearrange table columns. If Alt key is not pressed, mouse dragging on header will select the columns. Editing Table You can edit table cell by double clicking on it. You can enter either a number or an expression (e.g. typing pi in a cell results in 3.1416, typing 1+2 results in 3). See Formula Syntax section for expression syntax.
12
Table header highlighting On the screenshot above: Column A has no formula Column B has a formula, auto recalculation is off Column C has a formula, auto recalculation is on, so this column is not editable
See Also
Setting Column Formula Formula Syntax Table Sorting Missing Values (NaN) in Tables and Calculations
a positive or negative infinity). Arithmetic operations involving NaN always produce NaN, allowing the value to propagate through a calculation so that errors can be detected at the end without extensive testing during intermediate stages. A NaN does not compare equal to any number or NaN. How does a NaN appear? There are three kinds of operations which return NaN: 1. Operations with a NaN as at least one operand, e.g. 1+NaN 2. Indeterminate forms Divisions 0/0, /, /-, -/, -/- Multiplications 0*, 0*(-) Power 1^ Additions +(-), (-)+ and equivalent subtractions. 3. Real operations with complex results Square root of a negative number Logarithm of a negative number Tangent of an odd multiple of 90 degrees (or /2 radians) Inverse sine or cosine of a number which is less than -1 or greater than +1.
Examples Expression 0^0 0/0 sqrt(-1) 1/0 -1/0 Result 1 NaN NaN Infinity -Infinity
NaN in Expressions
You can use predefined constants NaN, nan or NAN in expressions to specify NaN value.
Example
If you set a Column Formula if(col(B) >= 0, col(B), NaN), it will return only positive values from column B. Negative values are replaced with NaN value. You can use this expression to filter negative values if you do not 14
want to use them in future calculations. Note that Not-a-Number returned at row # warning can be shown for such expressions.
What Data are Plotted on the Copied Fit Plots and Figures
If the only Fit Plots and Figures are selected for creating a copy, the created Fit Plots and Figures will use data from the same tables and columns as initial ones. If you select also the Tables which contain plotted data, then the created Fit Plots and Figures will use data from created copies of these Tables.
15
Fitting Methodology
'Nonlinear' means here that analytical fitting function depends nonlinearly on varying parameters (fit parameters). Fit procedure iteratively varies the parameters of fit function to minimize the residual sum of squares. Nonlinear fitting algorithm needs the user to set the initial values of fit parameters. To fit the data, implement these steps: 1. Create a Fit Plot, specify Y errors in Fit Plot properties, if any 2. Specify fit function by adding Fit Curves 3. Specify initial values of fit parameters (drag curves or enter accurate values) 4. Specify used X data interval 5. Run fitting You can undo fit and also undo changing initial parameters as any other action 16
using Undo function. It is a handy feature when experimenting with different models and initial parameters. Further reading This manual does not completely cover the complex nonlinear fitting methodology. We recommend you to take a look at this book: H. Motulsky and A. Christopoulos, Fitting Models to Biological Data Using Linear and Nonlinear Regression: A Practical Guide to Curve Fitting. 2003, GraphPad Software Inc., San Diego CA, graphpad.com. PDF is available for free here.
Fit example
17
Fit Curves table Show: Specifies whether to show this Fit Curve on plot. Active only if Baseline checkbox is not set Baseline: Toggles the subtracting of this Fit Curve from experimental data. You also can use Residual button to subtract all Fit Sum from data Sum: Specifies whether to use this Fit Curve in sum fit function Below the Fit Curves list is a parameters table which shows names, values, and descriptions of parameters relating to selected Fit Curve. Fitting by Sum and Fitting One Curve MagicPlot allows two alternatives buttons to run the fit: Fit by Sum button will fit the data with the sum of Fit Curves for which the Sum checkbox is set. Data interval from Fit Interval tab will be used. This button must be used for example to fit the spectrum with the sum of peaks. Fit One Curve button will fit the data with the one currently selected Fit Curve. Individual interval for each Fit Curve will be used. Set Edit Interval checkbox to edit individual interval for each Fit Curve. Copying and Pasting Fit Curves You can copy and paste Fit Curves from one Fit Plot to another Fit Plot or Figure. You can also paste the copied Fit Curves to the same Fit Plot to create a copy. The copy of Fit Curves with the same parameters and styles will be created if you paste Fit Curves to a Fit Plot. A link to the source Fit Curves will be inserted if you paste Fit Curves in a Figure. Fit Curves Reordering You can reorder Fit Curves by dragging them in table. The data curve is always drawn the first and fit sum is drawn the last.
18
types (not custom equation): you can drag curves on plot. Initial parameters values for each Fit Curve can also be set in parameter table.
Moving curves with mouse Adjusting Parameters with Mouse Wheel You can adjust Parameters in table using mouse wheel scrolling when mouse cursor is on the desired parameter: Hold Ctrl key (Cmd key on Mac) and scroll. If Shift key is also pressed the parameter step for one wheel 'click' will be increased.
Guessing Peaks
If you are fitting a spectrum with multiple peaks, MagicPlot may automatically add and approximately locate peaks before fitting (Pro edition only). See Guessing Peaks (Pro edition only) for details. Guessed peaks should be used only as the initial estimate for fitting.
Parameter Locking
You can lock (fix) parameter(s) to prevent varying this parameter(s) during fit and to prevent its changing due to setting initial values by mouse dragging (for built-in functions). Set the checkbox in Lock column in parameters list to lock parameter.
Table of Parameters
Parameters Joining
MagicPlot allows joining (sometimes referred to as coupling, binding, linking) of fit parameters of different Fit Curves. See Joining the Parameters of Fit Curves for details.
19
20
Press and hold the Residual button. The residual will be shown while button is pressed. You can use either mouse or space key (if button is selected) to hold Residual button. You can either set Baseline checkboxes for all summed Fit Curves to subtract them from data and explore the residual plot
Fitting
To execute the fit click the Fit by Sum button of Fit One Curve button (see below). MagicPlot indicates fit process with a special window. Fitting curves are periodically updated on plot while fitting so you can see how fit converges.
Fit progress window MagicPlot shows current iteration number and deviation decrement with two progress bars while fit is performed. The fit process stops when one of these progress bars reaches the end. You can see two buttons on fit progress window: Break Iterations: Breaks iterations after current iteration. Use this button if you suspect that further iterations will not change the result. Undo Fit: Breaks iterations and reverts fit parameters to their initial (before fit) values. Use this button if you see that fit process converges to wrong result; change initial values of parameters and run fit again.
22
Fit is not converged through one or more parameters: some parameters were taking unrealistically great values during iterations. There are no local minimum of residual sum of squares near the initial values of these parameters. MagicPlot highlights the suspicious Fit Curve in this case. Mutual dependency exists between some parameters. The algorithm cannot resolve which parameter to vary. Fit function is ill-conditioned: the minimized residual sum of squares depends on some parameters much more than on other ones.
Try one of the following:
Specify more accurate initial values of parameters. Simplify the fit function (e.g. remove some peaks). Lock some parameters.
See Also
Fitting Algorithm and Computational Formulas Specifying Custom Fit Equation (Pro edition only) Using Spline for Baseline Subtraction (Pro edition only) Joining the Parameters of Fit Curves Guessing Peaks (Pro edition only) Predefined Fit Curves Equations
23
Transform X or Y Fit Plot Data (Pro edition only) Calculating Integrals and Statistics (Pro) on Intervals using Fit Plot Creating x-y Table from Fit Curves
here: xi and yi are the data points, N is total number of points, f(x, 1,,p) is the fit function which depends on value of x and fit parameters k, p is the number of fit parameters k, wi are normalized (wi = 1) data weighting coefficients for each point (xi, yi). An initial guess for the parameters has to be provided to start minimization. Calculation of the new guess of parameters on each fit iteration is based on the fit function partial derivatives for current values of fit parameters and for each x value:
24
In Fit Plot Properties dialog (Plot Data tab) you can set one of the following methods to evaluate standard y errors si: Get y errors from table column(s), Percent of data for every point, Fixed value or Standard deviation do not use in weighting because in this case the error values are the same for all data points.
Deviation decrement shows how the residual sum of squares (RSS) on current iteration relatively differs from that on the previous iteration. The iterative fit procedure stops on one of two conditions: If the deviation decrements D for two last iterations is less than minimum allowable deviation decrement, which is 10-9 by default If the number of iterations exceeds maximum number of iterations, which is 100 by default You can change the minimum allowable deviation decrement and maximum number of iterations in Fitting tab of MagicPlot Preferences.
Formulas
In the table below you can find the formulas which MagicPlot uses to calculate fit parameters and values in Fit Report tab. Because of some confusion in the names of the parameters in different sources (books and software), we also give many different names of same parameter in note column.
Parameter Name Symbol Formula Note
Original Data and Fit Model Properties This is the number of data points inside specified Fit Interval. For peak-like functions (Gauss, Lorentz) these parameters are amplitude, position and half width at half maximum.
25
Number of fit function parameters Degrees of freedom Estimated mean of data Estimated variance of data Data total sum of squares, TSS TSS
This is the total number of parameters of all fit curves which are summarized to fit.
TSS is also called sum of squares about the mean and acronym SST is also used. Fit Result
Reduced 2
This value is minimized during the fit to find the optimal fit function parameters. RSS is also called the sum of squared residuals (SSR), the error sum of squares (ESS), the sum of squares due to error (SSE). The advantage of the reduced chisquared is that it already normalizes for the number of data points and model (fit function) complexity. Reduced 2 is also called mean square error (MSE) or the residual mean square. Standard deviation is also called root mean square of the error (Root MSE) R2 will be equal to one if fit is perfect, and to zero otherwise. This is a biased estimate of the population R2, and will never decrease if additional fit parameters (fit curves) are added, even if they are irrelevant. Adjusted R2 (or degrees of freedom adjusted R-square) is a slightly modified version of R2, designed to penalize for the excess number of fit parameters (fit curves) which do not add to the explanatory power of the regression. This statistic is always smaller than R2, can decrease as you add new fit curves, and even be negative for poorly fitting models Here is the matrix of partial derivatives of fit function with respect to parameters m and n which is used for fitting:
Adjusted R2
26
See Also
Nonlinear Curve Fitting: Fit Plot Specifying Custom Fit Equation (Pro edition only) Using Spline for Baseline Subtraction (Pro edition only) Joining the Parameters of Fit Curves Guessing Peaks (Pro edition only) Predefined Fit Curves Equations Transform X or Y Fit Plot Data (Pro edition only) Calculating Integrals and Statistics (Pro) on Intervals using Fit Plot
27
Joining parameters example To join parameters of two or more Fit Curves select one of desired Fit Curves, then select desired parameter in parameters table and press Join button in the bottom of the panel (or double click on parameter). You can specify the selected parameters as equal or proportional by entering multiplier and constant for each parameter. Joined parameters are shown with blue color (instead of black) in curve parameters table in Fit Plot window. Joined parameters are treated as one parameter when fitting, so joining results in the reducing of actual model parameters number. In the example above the areas and widths of tho peaks are joined and are equal. The positions of maximums are joined and inverse: -1 multiplier is set to the width of Curve 3.
See Also
Nonlinear Curve Fitting: Fit Plot
29
Fit Parameters
You can introduce Fit Curve parameters with any names except argument x, and constants like e, pi (see predefined constants for details): Parameters names are case-sensitive (a and A are different parameters). Parameters names lengths are not limited. Begin names with letter or _ sign. You can use numbers in the middle or in the end of the name: a1, a_1, A1, a1t, but the names like 1a are not allowed. The parameters you introduce in formula will automatically and immediately occur in parameters list, you do not need to enter parameters names in the list manually. Random values are used as the initial values of parameters. Do not forget to set more relevant initial values, otherwise fit algorithm may fail.
30
See Also
Nonlinear Curve Fitting: Fit Plot Using Spline for Baseline Subtraction (Pro edition only) Predefined Fit Curves Equations
Editing Spline
Created spline has three anchor points by default. You can move, add and remove anchor points: Move anchor point with mouse Double click on spline curve to add new anchor point Double click on anchor point to remove it Set Baseline checkbox in spline row in fit curves table to subtract spline from data.
31
32
See Also
Nonlinear Curve Fitting: Fit Plot Specifying Custom Fit Equation (Pro edition only) Guessing Peaks (Pro edition only) Predefined Fit Curves Equations
33
See Also
Nonlinear Curve Fitting: Fit Plot Specifying Custom Fit Equation (Pro edition only) Using Spline for Baseline Subtraction (Pro edition only)
34
Gaussian
Area:
Standard deviation:
Gaussian-A (normalized)
Amplitude:
Standard deviation:
Lorentzian
Area:
Lorentzian-A (normalized)
Amplitude:
Gauss Derivative
Standard deviation:
Peak-to-peak horizontal:
Peak-to-peak vertical:
Lorentz Derivative
35
Peak-to-peak vertical:
See Also
Nonlinear Curve Fitting: Fit Plot Using Spline for Baseline Subtraction (Pro edition only) Guessing Peaks (Pro edition only)
36
Data Processing
Setting Column Formula
Use Table Set Column Formula menu item to open column formula dialog window. See formula syntax for details.
Row Index
Variable i contains the current row index. Rows are enumerated from 1.
You can use this behavior to calculate factorial: set 1 in the first row of column A and after that set formula cell(A, i-1) * i and rows interval from 2 to 100. Note that formula is to be set for rows beginning from the second, and not from the first. You will get the factorial of row number (i).
col(A) returns the value of cell in column A in the current (i-th) row. Equivalent to cell(A, i). cell(A, 3) returns the value in column A and row 3. You can use either upper-case letters (AZ, e.g. col(B)) or numbers (1, 2, 3,.., e.g. col(1)) in columns numeration in arguments of col and cell functions.
Example
Set formula col(A)*2 for column B and set Auto Recalculate checkbox. Column B will be recalculated if you change values in column A or column A is updated by other formula or processing algorithm (e.g. integral, derivative of other column).
38
Formula Menu
See Also
Formula syntax
39
Baseline Correction
If your initial data to be integrated contains a baseline (usually constant or linear), you may want to subtract it from data before integrating. (A constant baseline will result in linearly growing integral.) In such case the algorithm may be the following: 1. Create Fit Plot with your initial table data 2. Add a Fit Curve which simulates the baseline. You may specify a custom equation (Pro edition only) 3. Specify Fit Interval so that it contains only noise points 4. Fit the data by clicking Fit Sum button 5. Subtract the baseline fitting curve from data by checking Baseline checkbox in curves list 6. Use menu Processing Integrate to integrate the plotted data without baseline.
Formula
To perform integration you should specify two columns: x and y. Missing values are ignored. MagicPlot uses trapezoidal rule to compute the integral:
See Also
Differentiation (Pro edition only)
40
Formula
To perform differentiation you should specify two columns: x and y. Missing values are ignored. MagicPlot uses central difference formula to compute the derivative:
First and last points (i=1 and i=N) are computed as follows:
See Also
Integration (Pro edition only)
41
Formulas
Discrete Fourier Transform Formulas By default MagicPlot uses 'electrical engineering' convention to set the sign of the exponential phase factor of FFT: forward transform is computed using factor -1. Most scientific applications use factor -1 in forward transform as MagicPlot does by default. But note that the sign of exponential phase factor in Numerical Receipts in C, 2nd edition, p. 503 and in MATLAB package in forward transform is +1.
1/N in forward transform Checked (Default) Unchecked Factor 1 (Default) Forward Transform (SignalSpectrum) Inverse Transform (SpectrumSignal)
42
Here cn are complex signal components and Cn are complex spectrum components, n = 1N. The only difference is in the sign of exponential phase factor and 1/N multiplier. Note: if you expect to get the original data when doing an inverse FFT of forward FFT, set the 1/N in Forward Transform, Center Zero Frequency and Factor options the same for forward and inverse transforms. Amplitude and Phase Columns Formulas
Because of using atan2 function the phase is unwrapped and is in range (, ]. The result of atan2(y, x) is similar to calculating the arc tangent of y/x, except that the signs of both arguments are used to determine the quadrant of the result. Sampling Column Formulas Sampling column contains frequency samples if forward transform is performed and time samples in case of inverse transform.
Center zero frequency Unchecked Checked Formula Sampling Column Values
Here t is given sampling interval of initial data (time for FFT and frequency for IFFT), n = 1N. Missing Values in the Original Data Fourier transform implies that the original samples are uniformly distributed in time (for forward transform) or frequency (for inverse transform). Missing values in the middle or in beginning of original data columns are treated as zeros, the result of Fourier transform may be incorrect. Missing values in the end of the column are ignored.
43
Parameters
Sampling Interval Sampling interval of original data t is used to compute the data in resulting sampling column. If Get from box is set, MagicPlot will calculate sampling interval as a difference between two first values from given column. You can set sampling interval manually by checking Set manually box. Note that using of discrete Fourier transform implies that the samples in your original data are equally spaced in time/frequency, i.e. the sampling interval is constant. If the sampling interval is varying or real and/or imaginary data contains empty cells in the middle, the result of discrete Fourier transform will be incorrect. Columns with real and imaginary components of data. If your data is purely real, select <all zeros> imaginary item Transform direction (here Inverse equals to Backward)
Real, Imaginary Forward / Inverse 1/N in forward Also referred as 'Normalize' in some applications. Divide forward transform transform result by number of points N (see formulas table). If your original data is real, you may want to additionally multiply the result by 2 to get the true amplitudes of real signal Center zero If selected, after forward Fourier transform the two parts of spectrum will be frequency rearranged so that the lower frequency components are in the center; the opposite rearrangement of spectrum will be done before inverse transform if any.
Binning Options
You can either set the bin size/count manually or specify auto binning criteria.
44
Bin Bounds MagicPlot align the the lower limit of the first bin exactly at the beginning of specified histogram range (From field). The upper limit of the last bin is calculated on the basis of the specified bin size and may be greater than the specified right histogram limit (to field) as shown on the screenshot above. Enter round value in the From field if you want the lower limit of the first bin to be round.
Typing k=... means setting the number of bins k Typing h=... means setting the bin size h.
You can use these parameters in the expression:
n the number of data points s data standard deviation m data mean min data minimum max data maximum.
The default alternatives are:
Default criteria in Excel, Origin and some other software Scott's formula Sturges' formula
MISE optimisation Shimazaki method. MagicPlot finds the minimum of Mean Integrated Squared Error (MISE) for the number of bins from 2 to min(n/2, 20n1/2) where n is the number of data points. See this paper and site for details: Shimazaki and Shinomoto, Neural Comput 19 1503-1527, 2007, http://2000.jukuin.keio.ac.jp/shimazaki/res/histogram.html. 'Keep on Recalculation' Option This option is used when the histogram is recalculated. Recalculation may be cause by input data change (if Auto Recalculate checkbox is selected) or invoked manually (Recalculate menu item in histogram table column context menu).
Preview Plot
The preview plot shows the histogram which is evaluated according to 45
selected parameters. It also shows the data point positions on X axis in the bottom of the plot.
Statistics dialog Showed Statistical Properties By default some statistical properties are not shown. Click Show button to select which properties you want to calculate.
Statistical data and integrals are automatically updated if x or y data are changed or intervals are changed.
Integration on intervals All statistical data are summarized in the intervals table:
Statistics on intervals
Managing Intervals
Move interval borders with mouse. Double click on interval to split it at desired position. Right click opens context menu from which new intervals can be created on free space and existing intervals can be deleted or split.
Formulas
MagicPlot uses the following formulas to calculate intervals statistics:
Property Integral Formula Calculated using Trapezoidal rule
47
Kurtosis
Y Sum
See Also
Nonlinear Curve Fitting: Fit Plot Using Spline for Baseline Subtraction (Pro edition only) Descriptive Statistics (Pro edition only)
See Also
Nonlinear Curve Fitting: Fit Plot
Formula Syntax
Formula editor is used in the following cases: Setting Column Formula Custom Fit Curve Entering value in any numeric field and in tables MagicPlot Calculator 48
MagicPlot uses standard IEEE 754 double precision floating-point arithmetic. Double precision floating point takes 8 bytes per number and provides a relative precision of about 16 decimal digits and magnitude range from about 10-308 to about 10+308. Syntax Highlighting MagicPlot formula editor highlights expression syntax. It also marks matching brackets:
General Rules
Case Sensitivity MagicPlot formula translator is generally case sensitive, i.e. you can write sin but not Sin. Note that x and X are different variables. You can use this feature when naming Custom Equation Fit Curve parameters. Entering Numbers You can use dot (.) or comma (,) as decimal separator, and separate function arguments with a semicolon (;) in the following cases: Cell editing in Tables Entering value in any numeric field Using MagicPlot Calculator You can use dot (.) only as decimal separator, and separate function arguments with a comma (.) or a semicolon (;), in: Setting Column Formula Custom Fit Curve You can use e or E for scientific notation: 1.45e-3 or 1.45E-3. Using Spaces and Line Breaks You can freely insert space characters and line breaks in formula, but do not break function names, numbers, operators. You do not need to enter special characters to indicate line break.
Functions
You can see a list of all available functions and their descriptions in Functions tab in Set Column Formula window and in Help on Functions window which can be opened from menu in calculator window. MagicPlot uses functions of Java programming language library StrictMath to 49
evaluate sin, cos, exp, etc. These functions are available from the well-known network library netlib as a Freely Distributable Math Library, fdlibm package. The same library is widely used in many scientific computing applications. Trigonometric Functions MagicPlot supports all standard trigonometric functions (sin, cos, etc.). All angles are always measured in radians for clarity. You can use the following functions to convert angles units: deg(a) converts angles input in radians to an equivalent measure in degrees. rad(a) converts angles input in degrees to an equivalent measure in radians.
Examples
sin(rad(90)) deg(asin(1)) Constants The predefined constants are: pi, Pi, PI = 3.1416 value (the ratio of circumference of a circle to its diameter). e e = 2.7183 value (the base of the natural logarithms). Note: expression e^a is evaluated as exp(a). nan, NaN, NAN Not-a-Number value. inf, Inf, infinity, Infinity positive infinity value which may be used in some calculations. Note: write -inf for negative infinity. eps machine epsilon, gives an upper bound of the relative error due to rounding in floating point arithmetic. Note: eps = ulp(1) = 2^(-52) = 2,2204E-16. (52 is the number of bits used to store fractional part of a number.)
Boolean Logic
MagicPlot can interpret boolean logic expressions. Zero and negative values (<=0) are interpreted as false and positive values (>0) are interpreted as true similarly to C programming language. You can use simple logical operators which are described below. Use 1 as true and 0 as false. 'if' Function The basic logical function is if(condition, a, b). If condition argument is
50
true (greater than 0) it returns the second argument (a), else returns the third argument (b).
Examples
if(col(A) >= 0, col(A), -col(A)) evaluates absolute value of column A (you can use abs(col(A)) for that, of course). if(col(B) >= 0, col(B), NaN) returns only positive values from column B. Negative values are replaced with NaN value (empty cell). You can use this expression to filter negative values if you do not want to use them in future calculations. Note that Not-a-Number returned at row # warning can be shown for such expression. if(col(A) > 0 & col(B) > 0, max(col(A), col(B)), NaN) Equality Checking You have to be careful if you need to check equality of two values. Due to inaccuracy of computer floating-point calculations the result of evaluation is always approximate. For example, result of sqrt(3)^2 is number 2.9999999999999996, not exactly 3. The expression sqrt(3)^2 == 3 is false (it returns 0). Keep in mind that for convenience MagicPlot rounds numbers when showing on the screen, so this value will be shown as 3 in table if the number of shown fractional digits in MagicPlot preferences is not big enough. Generally, if you want to check equality of two values you need to use some equality threshold for relative difference. That is, you should compare the modulus of relative difference of two values a and b with threshold t: if(abs((a-b)/a) < t, , ).
Examples
sqrt(3)^2 - 3 results something about -4,4409E-16 if(abs(sqrt(3)^2 - 3) / 3 < 1e-10, , ) checks equality of sqrt(3)^2 and 3 with a threshold of 1e-10.
Operators
Operator + * / ^ | & Description addition subtraction multiplication division power or and Operator == != < > <= >= Description equal to not equal to less than greater than less than or equal to greater than or equal to
Operations Priority Operators with lower precedence value are evaluated earlier. You can use brackets to change calculation sequence. 51
Expression is evaluated left-to-right, excluding repeated exponentiation operator ^. The ^ operator is right-associative like in Fortran language (evaluated right-to-left; note that in general case a^(b^c) (a^b)^c). Hence a^b^c is evaluated as a^(b^c). The reason for exponentiation being right-associative is that a repeated leftassociative exponentiation operation would be less useful. Multiple appearances could (and would) be rewritten with multiplication: (a^b)^c = a^(b*c).
Operations () (function call) ^ - (unary minus) *, / +, <, >, <=, >= ==, != & | = (assignment) Examples Precedence 1 2 3 4 5 6 7 8 9 10 Associativity Right-to-left Left-to-right Left-to-right Left-to-right Left-to-right Left-to-right Left-to-right Left-to-right
1 + 2 * 3 returns 7. (1 + 2) * 3 returns 9. 2*-3 returns -6. -3^2 is equal to -(3^2), because ^ priority is higher than that of unary minus. The result is -9. (-3)^2 returns 9. 2^2^3 is equal to 2^(2^3), because ^ is right-associative operator. The result is 256.
Table Sorting
To sort Table select Table Sort Table menu item. You can sort the entire table or only selected area (columns and rows selection). You can also use Sort by This Column item in Table context menu (exactly one column must be selected).
52
Sorting Criteria
Sort table dialog You may specify multiple sorting criteria columns. If the value in the first criteria column are the same MagicPlot will compare the values from the second criteria column if specified.
53
Current Axes
If your Figure contains more than one Axes box, MagicPlot indicates which Axes are currently selected with blue circle sectors in the corners of Axes box. The current Axes selection affects the action of scale buttons and Add to Selected Axes item in Table context menu. It also helps you to distinguish the Axes when you change style in the Figure Properties dialog window.
54
See Also
Drawing on Figures and Fit Plots, Image Zoom and Objects Selection Reading Plot Data, Measuring Distances, Curves Selection
Crosshair Cursor
MagicPlot can draw crosshair cursor. To turn it on use View Crosshair Cursor menu item.
55
Curve context menu on Figure Use context menu of the Curve to open table with data or to open properties dialog.
Distance measurement
Curve 1 is selected
57
Curve 2 is selected
See Also
Scale Scrolling for Data Navigation
Quick Plot tool When Quick Plot window is open select some columns in Table to view the plot. 58
Editing Figures
Adding and Arranging Axes on Figure
You can add new Axes on Figure using Add menu either in Figure window or in Figure properties window. If you want to arrange existing Axes as table also select Add & Arrange Axes as Table item.
59
Arrange Axes as table dialog This dialog may be used also to arrange existing Axes without adding new Axes.
60
61
2D Waterfall Figure Specified Curve shifts do not affect your data and are used only for drawing current Figure. Curve shifts can be set in X Shift and Y Shift columns in Axes Components table (scroll table right if these columns are not visible). Waterfall menu contains items for making and resetting 2D waterfall and reversing curves order. Reset Shifts sets all x and y shifts to zero Make Waterfall automatically calculates shifts and arranges Curves Make Waterfall menu item opens waterfall window in which you can specify shift increment. MagicPlot tries to guess handsome shift values on the basis of number of curves and current scale.
Waterfall window
62
to Figure. Note that the Figure style will not be changed if you change the template after you have applied it to Figure. The project file is standalone and you do not need the template to open project. You can undo applying template in a standard manner (no need to close the Figure Properties window).
64
Drawing on Figures and Fit Plots, Image Zoom and Objects Selection
You can draw the following kinds of objects on Figures and Fit Plots (Pro edition only): Text labels with formatting support Lines Arrows Rectangles Ellipses 65
Select an appropriate instrument in the toolbar to draw an object. The properties of selected objects can be changed in the inspector toolbar (the second row of toolbar).
Objects selection
Every object can be selected by clicking on its border or inside it. Hold Ctrl key (Windows, Linux) or Shift key (Mac OS) and click another object to add it to current selection.
66
67
See Also
Scale Scrolling for Data Navigation Reading Plot Data, Measuring Distances, Curves Selection
See Also
Creating Transparent Figures and Fit Plots
white chequerboard. If you are preparing a picture for a dark background you can change the colour of chequerboard to dark grey by selecting View Transparency Checkerboard in main menu. In case of transparent background you can set the preview background colour in Image Preview window.
See Also
Colours and Opacity Adjustment
Drawing Dimensions toolbar Drawing Dimensions toolbar shows the coordinates and size of currently selected object(s). You can also specify the coordinates or size of several components. The x value is measured from the left edge of the canvas. The y value is measured from the top edge of the canvas.
69
For rectangle or ellipse the specified coordinates determine the position of the upper-left corner. For text label: x determines the left edge, center or right edge of text according to text alignment of label. y determines the baseline position of the first line. For line or arrow the specified coordinates determine the position of the beginning.
Antialiasing off
Antialiasing on
You can toggle curves antialiasing (smoothing) by selecting View Curves Antialiasing in main menu. Please note that antialiasing may slow down the drawing if you have many data points (~100K).
70
Symbol On Keyboard (Ctrl+M, then) Multiplication sign * or x Middle dot (multiplication) . (dot) Division slash / Minus sign Plus-minus sign + Minus-plus sign = Not equal n Infinity 8
Symbol name
To see the full list of shortcuts select Help Insert Greek Letters and Math menu item.
72
See Also
Advanced Typography Features
Ligatures Support
MagicPlot supports Latin ligatures in text labels. If you type 'fi', 'fl', etc., those symbols will be shown with ligature glyphs when you exit edit mode.
Edit mode
Result
MagicPlot supports at least the following ligatures: fi, fl ff, ffi, ffl Not all fonts contain ligature glyphs. MagicPlot displays ligatures only if the glyphs are included in used font. You can turn the ligatures off in MagicPlot preferences.
73
Plus and minus signs When you edit some text, keyboard minus key enters hyphen-minus character. The correct minus character can be typed in text label by pressing Ctrl+M, -, see Inserting Special Symbols for details. Multiplication Sign In different languages, multiplication signs differ. In most cases you have to use either '' or '' sign. You also can specify any special character or character sequence, for example enter spaces before and after multiplication signs.
Multiplication sign Correct minus sign Middle dot Correct minus sign Simplified typography: Latin letter 'x' hyphen-minus instead of minus
See Also
Inserting Special Symbols and Greek Letters
74
PNG
JPEG
75
See Also
Copying Images to Clipboard (Pro edition only) Preview Image
Preview Image
Use Project Image Preview menu item to open image preview window. You can also use the Preview button of the toolbar or Ctrl+Shift+P keyboard shortcut (Cmd+Shift+P on Mac).
Preview Features
In preview mode you can: Preview in gray scale Transparent images can be previewed on selected background color Change the zoom of the image
76
See Also
Image Export
77
Tools
MagicPlot Calculator
MagicPlot Calculator is a useful formula calculator built in MagicPlot. To open calculator use Tools Calculator menu item. Calculator window stays on top when MagicPlot main window is minimized to task bar (Dock on Mac), so you can use the Calculator when working with other applications.
78
See Also
Formula Syntax Download MagicPlot Calculator as a standalone application
79
Appendices
Portable Installation on USB drive
You can copy MagicPlot executable file to your portable USB drive and launch it on some other computer directly from this USB drive, without installation. To do this, you have to copy MagicPlot preferences file to the folder on USB drive which contains MagicPlot executable file. Here are step-by-step instructions: 1. Create new folder on USB drive for MagicPlot 2. Copy MagicPlot executable file to this folder 3. Run MagicPlot 4. Exit MagicPlot. It will automatically store preferences file magicplot.ini in MagicPlot folder in your operating system profile (see below) 5. Copy magicplot.ini from MagicPlot folder in your operating system profile to the folder on USB drive which contains MagicPlot executable.
Where does MagicPlot save preferences in my operating system profile?
Windows XP: C:\Documents and Settings\<Your account>\Application Data\MagicPlot\ Windows Vista, 7: C:\Users\<Your account>\AppData\Roaming\MagicPlot\ Mac OS X: <home>/Library/Application Support/MagicPlot Unix-like systems: <home>/.magicplot.
Price
General Multiple operating systems support (Windows, Mac OS X, Unix-like) No installation procedure, portable installation is available Unicode support in projects Undo and redo for all actions (with unlimited depth and history list) Import tables from text files (.csv, .txt), import dialog with preview
+ + + + +
80
Double precision floating point tables with copy/paste support to/from other apps Built-in formula calculator tool Entering expressions in every numeric text field Setting column calculation formulas with syntax highlighting and formula history Optional auto recalculation of column when data in use are changed Nonlinear Curve Fitting Multi-peak fitting Fitting with sum of different functions Predefined Gauss and Lorentz functions and their derivatives Visual peaks adjusting (fit initial conditions) Visual fitting interval setting Y data errors accounting Easy subtraction of baseline and peak fitting functions from experimental data Copying and pasting Fit Curves from one Fit Plot to another Automatic peaks finding by 2nd derivative Splines for baseline subtraction with fitting capability Specifying custom fit equations Data Processing Numerical integration of peaks in spectrum on specified intervals Integration of data Differentiation of data Fast Fourier transform Histograms Descriptive Statistics Numerical spectrum moments (mean, variance, etc.) calculation on selected intervals Table Sorting by multiple columns, table transposing Plotting Features Plotting capabilities: lines, markers, drop lines, vertical bars, filling under curve Error bars Switching curves antialiasing on screen Fully customizable style for each axis (ticks, labels, grid, etc.) Custom grid lines and labels at specified positions Transparent images and translucent colors of every object In-place text labels editing with formatting support 2D waterfall plots and setting individual shifts for curves Image zooming in for precise drawing Multiple axes on one figure, aligning axes Drawing: text labels, lines, arrows, rectangles, ellipses Precise objects positioning with snapping and rulers Saving and applying Figure templates
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
81
Data Navigation and Exploration Mouse cursor data coordinates in status bar Showing data point and table row numbers for point under cursor X and Y scrollbars for data navigation Box zoom tool for scale Hand drag tool for scale Mouse wheel or touchpad scale scrolling and zooming Quick Plot tool for viewing plot without adding new Figures to Project Figures Typography Correct minus and multiplication signs (instead of hyphen and letter x) in exponential notation English ligatures support (fi, etc.) Tracking Inserting special symbols (Greek letters, math symbols, dashes, etc.) Image Export Raster images export formats: PNG, GIF, BMP Vector images export formats: EPS, PDF, EMF Copying of raster images to clipboard Copying of vector images to clipboard Usage and Support Commercial usage E-mail support (write to support(at)magicplot.com)
+ + + + + +
+ + + + + + +
+ + + +
+ + + +
+ + + + + +
MagicPlot Student can also be used to view project files created in fullfeatured MagicPlot Pro edition. In such case some project elements (e.g. Custom fit curve formulas) will not be editable.
Keyboard Shortcuts
MagicPlot keyboard shortcuts are almost the same in different operating systems (Windows, Mac OS, UNIX-like). The main difference is in modifier keys used: Ctrl on PC (Windows, UNIX-like) and Command on Mac. Some shortcuts were altered to avoid coincidences with system ones. You can find these keyboard shortcuts in MagicPlot by selecting Help Keyboard Shortcuts menu item.
Mac Keyboard Symbols
Command (Meta) key Shift key Option (Alt) key Control key
82
Common Shortcuts
Windows and UNIX-like Key Ctrl+O O Ctrl+S S Ctrl+Shift+S S Ctrl+N N Ctrl+I I Ctrl+P P Ctrl+Shift+P P Ctrl+E E Ctrl+K K Ctrl+U U Ctrl+Q Q Ctrl+Z Ctrl+Shift+Z or Ctrl+Y Ctrl+H Mac OS Key Action Open project Save project Save project as New project Import table from text file Print (image or table) Preview image Export image Open calculator MagicPlot preferences Quit Undo Redo Show command history window Cut Copy Paste Select all
Table Shortcuts
Windows and UNIX-like Key F2 or Double click Ctrl+F2 F4 Ctrl+Enter Alt+Drag header (Win/Meta+Drag header on UNIX) Mac OS Key Double click F2 F4 Return Drag header Action Edit cell Set or edit column formula Rename column (edit header) Recalculate column Rearrange table columns
83
Shift+Drag corners
Drag corners
Alt+Drag corners
Drag corners Text Labels Editing Return or Return Escape Return G, then letter
1
For rectangle and ellipse: preserve aspect ratio For line and arrow: disable snapping to 0, 45, 90 For rectangle and ellipse: stretch relative to center
Apply changes Apply changes New line Type Greek letter (letters correspondence) Ctrl+M, then symbol M, then symbol Type special math symbol (symbol list) Ctrl+B B Bold Ctrl+I I Italic Ctrl+O O Oblique Ctrl+U U Underlined Ctrl+L L Align left Ctrl+E E Center Ctrl+R R Align right Ctrl+J J Justify Ctrl+ Subscript Ctrl++ + Superscript Scale Range Scrolling and Zoom 2 Scrolling Scrolling Vertical (Y) scale scrolling Shift+Scrolling Scrolling or Horizontal Horizontal (X) scale scrolling scrolling Ctrl+Scrolling Scrolling Vertical (Y) scale zooming Ctrl+Shift+Scrolling Scrolling or Horizontal Horizontal (X) scale zooming scrolling Left mouse button+Scrolling Scrolling Proportional (X and Y) scale zooming Image Zoom Ctrl++ + Zoom in Ctrl+ or Alt+Click or Click Zoom out Ctrl+* or Ctrl+0 * or 0 Full view
1 These shortcuts are activated in text label edit mode 2 Scrolling here means mouse wheel rotation or touchpad vertical scrolling or scrolling by other human interface device.
84