Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Qtiplot Manual en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 490

The QtiPlot Handbook

Ion Vasilief
The QtiPlot Handbook ii

Copyright © 2004 - 2023 Ion Vasilief


Copyright © 2010 Stephen Besch
Copyright © 2006 - june 2007 Roger Gadiou and Knut Franke

Legal notice: Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documen-
tation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.
The QtiPlot Handbook iii

COLLABORATORS

TITLE :

The QtiPlot Handbook

ACTION NAME DATE SIGNATURE

WRITTEN BY Ion Vasilief The 21st of February


2023

REVISION HISTORY

NUMBER DATE DESCRIPTION NAME


The QtiPlot Handbook iv

Contents

1 Introduction 1
1.1 What QtiPlot does . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Command Line Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.1 Specify a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2.2 Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 General Concepts and Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 Excel workbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.3 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.4 Plot Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.5 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.6 Results Log Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.7 The Project Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.8 The Quick Help Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.9 The Scripting Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Interoperability with other scientific software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.1 OriginLab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.1.1 Import of OriginLab projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.1.2 Export QtiPlot projects to OriginLab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.2 Microsoft Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.2.1 Import of Excel files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.2.2 Export QtiPlot data to Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.3 LibreOffice and Apache OpenOffice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.3.1 Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.3.2 Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
The QtiPlot Handbook v

2 Drawing plots with QtiPlot 17


2.1 2D plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.1 2D plot from data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.2 2D plot from function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.2.1 Direct plot of a function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.2.2 Filling of a table with the values of a function. . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 3D plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2.1 Direct 3D plot from a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2.2 3D plot from a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3 Multilayer Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.1 Building a multilayer plot panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.2 Building a multilayer plot step by step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3 Command Reference 30
3.1 The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1 File-> New -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1.1 New -> New Project (Ctrl-N) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1.2 New -> New Folder (F7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1.3 New -> New Table (Ctrl-T) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1.4 New -> New Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.1.5 New -> New Matrix (Ctrl-M) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.1.6 New -> New Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.1.7 New -> New Graph (Ctrl-G) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.1.1.8 New -> New Function Plot -> New Function Plot... (Ctrl-F) . . . . . . . . . . . . . . . . . . 32
3.1.1.9 New -> New Function Plot -> New Parametric Function Plot... . . . . . . . . . . . . . . . 33
3.1.1.10 New -> New Function Plot -> New Function 2D... (Ctrl-2) . . . . . . . . . . . . . . . . . . 33
3.1.1.11 New -> New Function Plot -> New 3D Surface Plot... (Ctrl-Alt-Z) . . . . . . . . . . . . . . 33
3.1.1.12 New -> New Function Plot -> New 3D Parametric Surface Plot... . . . . . . . . . . . . . . 33
3.1.2 File-> Recent Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.3 File -> Open (Ctrl-O) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.4 File -> Open Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.5 File -> Open ODF Spreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.6 File-> Open Image File (Ctrl-I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.7 File -> Append Project... (Ctrl-Alt-A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.8 File -> Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.9 File-> Convert files... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.10 File-> Save Project (Ctrl-S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.11 File-> Save Project as... (Ctrl-Shift-S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.12 File-> Save Window as... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
The QtiPlot Handbook vi

3.1.13 File -> Open Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34


3.1.14 File -> Save as Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1.15 File-> Print (Ctrl-P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1.16 File-> Print Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1.17 File-> Print All Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1.18 File -> Export Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.18.1 Export Graph -> Current (Alt-G) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.18.2 Export Graph -> All (Alt-X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.18.3 File -> Create Open Document Presentation... . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.19 File -> Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.19.1 Export ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.19.2 Export Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.19.3 Export to PDF (Ctrl-Alt-P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.20 File -> Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.20.1 File -> Import -> Import ASCII... (Ctrl-K) . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.20.2 File-> Import Image... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.1.20.3 File -> Import -> Database... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1.20.4 File -> Import -> Matlab... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1.20.5 File -> Import -> Sound (WAV)... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1.20.6 File -> Import -> NI (TDMS)... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1.21 File -> Quit (Ctrl-Q) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 The Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.1 Edit -> Undo (Ctrl-Z) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.2 Edit -> Redo (Ctrl-Shift-Z) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.3 Edit -> Cut Selection (Ctrl-X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.4 Edit -> Copy Selection (Ctrl-C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.5 Edit -> Copy Selection (full precision) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.6 Edit -> Delete Selection (Del) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.7 Paste -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.7.1 Paste -> Paste Selection (Ctrl-V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.7.2 Paste -> Transpose (Ctrl-Alt-T) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.7.3 Paste -> Paste Format (Ctrl-Shift-V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.8 Edit -> Delete Fit Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2.9 Edit -> Clear Log Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2.10 Edit -> Preferences... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 The View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.1 View -> Toolbars... (Ctrl-Shift-T) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.2 View -> Project Explorer (Ctrl-E) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.3 View -> Results log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
The QtiPlot Handbook vii

3.3.4 View -> Undo/Redo Stack... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39


3.3.5 View -> Quick Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.6 View -> Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.7 View -> Serial Monitor... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4 The Scripting Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.1 General Scripting Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.1.1 Scripting -> Scripting language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.1.2 Scripting -> Restart scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.1.3 Scripting -> Add Custom Script Action... . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2 Notes Specific Scripting Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2.1 Scripting -> Execute (Ctrl+J) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2.2 Scripting -> Preferences... (Ctrl+Shift+J) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2.3 Scripting -> Evaluate (Ctrl+Return) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2.4 Rename Tab... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4.2.5 Add Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.4.2.6 Close Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5 The Graph Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.1 Graph -> Add/Remove Curves... (Alt-C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.2 Graph -> Add Error Bars... (Ctrl-B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.3 Graph -> Add Function... (Ctrl-Alt-F) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.4 Graph -> Add Function 2D... (Ctrl-Alt-2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.5 Graph -> Rescale To Show All (Ctrl-Shift-R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.6 Graph -> Exchange X-Y Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.7 Graph -> New Legend (Ctrl-L) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.8 Graph -> New Table... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.9 Graph -> Add Color Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.10 Graph -> Add Equation... (Alt-Q) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.11 Graph -> Add Text (Alt-T) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.12 Graph -> Draw Arrow (Ctrl-Alt-A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.13 Graph -> Draw Line (Ctrl-Alt-L) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.14 Graph -> Add Rectangle (Ctrl-Alt-R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.15 Graph -> Add Ellipse (Ctrl-Alt-E) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.16 Graph -> Add Time Stamp (Ctrl-Alt-T) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5.17 Graph -> Add Image (Alt-I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5.18 Graph -> View Pixel Line Profile... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5.19 Graph -> Add Central Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5.19.1 Add Horizontal Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.5.19.2 Add Vertical Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.20 Graph -> Add Reference Line... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The QtiPlot Handbook viii

3.5.21 Z-Order Commands... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44


3.5.21.1 Move to Top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.21.2 Move to Bottom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.22 Graph -> Add Layer (Alt-L) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.23 Graph -> Add Empty Inset Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.24 Graph -> Add Inset Layer With Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5.25 Graph -> Arrange Layers... (Shift-A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.26 Graph -> Automatic Layout command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.27 Graph -> Fit Layers to Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.28 Graph -> Fit Window to Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.29 Graph -> Extract to Layers command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.30 Graph -> Extract to Graphs... command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.31 Graph -> Merge Graph Windows... command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.32 Graph -> Remove Layer (Alt-R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.6 The Plot Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.6.1 Plot Wizard (Ctrl-Alt-W) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.2 Line -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.2.1 Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.2.2 Line Central . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.2.3 Vertical Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6.2.4 Horizontal Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.6.3 Symbol -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.6.3.1 Scatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.6.3.2 Scatter Central . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.6.3.3 Vertical Drop Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.6.3.4 Bubble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.6.3.5 Color Mapped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.6.3.6 Bubble + Color Mapped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.6.4 Line + Symbol -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.6.4.1 Line+Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.6.4.2 Line + Symbol Central . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.6.4.3 Spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.6.5 Column/Bar/Pie -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.6.5.1 Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.6.5.2 Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6.5.3 Stack Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6.5.4 Stack Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6.5.5 100% Stack Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6.5.6 100% Stack Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
The QtiPlot Handbook ix

3.6.5.7 Floating Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


3.6.5.8 Floating Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.5.9 3D Color Pie Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.5.10 2D Color Pie Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.5.11 Doughnut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.6 Multi-Curve -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.6.1 Double-Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.6.2 3Y: Y-YY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.6.3 4Y: YY-YY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.6.6.4 Stack Lines by Y Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.6.6.5 Waterfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.6.6.6 Colormapped Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.6.7 Area -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.6.7.1 Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.6.7.2 Stack Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6.7.3 100% Stack Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6.7.4 Fill Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6.8 Special Line/Symbol -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6.8.1 Vectors XYXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6.8.2 Vectors XYAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.6.8.3 Zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.6.9 Statistical Graphs -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6.9.1 Box Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6.9.2 Box Plot + Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6.9.3 Interval Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.6.9.4 Scatter Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.6.9.5 Violin Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.6.9.6 Violin with Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.6.9.7 Ridgeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.6.9.8 Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.6.9.9 Histogram + Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.6.9.10 Histogram + Probabilities (Double-Y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.6.9.11 Stacked Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.6.9.12 Pareto Chart - Binned Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.6.9.13 Pareto Chart - Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.6.9.14 Bland-Altman Plot... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.6.9.15 Q-Q Plot... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.6.9.16 Stem and Leaf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.6.10 Panel -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
The QtiPlot Handbook x

3.6.10.1 Vertical 2 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66


3.6.10.2 Horizontal 2 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.6.10.3 4 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.6.10.4 Stacked Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.6.10.5 Custom Layout... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.6.11 3D XYY -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.6.11.1 Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.6.11.2 Inline Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.6.11.3 Stack Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.6.11.4 100% Stack Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.6.11.5 Ribbons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.6.11.6 Wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.6.11.7 Stacked Wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.6.11.8 100% Stacked Wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.6.11.9 Waterfall Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.6.11.10 Waterfall Plot (Color Mapped) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.6.11.11 Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.6.11.12 Stack Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.6.11.13 100% Stack Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.6.11.14 Trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.6.11.15 Scatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.6.11.16 Trajectory + Dots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6.12 3D Plot -> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6.12.1 Ribbons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6.12.2 Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.6.12.3 Scatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.6.12.4 Trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.6.12.5 Trajectory + Dots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.6.12.6 Vectors XYZ XYZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.6.12.7 Vectors XYZ dXdYdZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.7 The 3D Plot menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.7.1 3D Wire Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.7.2 3D Hidden Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.7.3 3D Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.7.4 3D Wire Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.7.5 Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.7.6 Scatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.7.7 Contour+Color Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.7.8 Countour Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
The QtiPlot Handbook xi

3.7.9 Countour Lines - Color Mapped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80


3.7.10 Gray Scale Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.7.11 Heat Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.8 The Data Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.8.1 Data -> Disable tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.8.2 Data -> Zoom In/Out and Drag Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.8.3 Data -> Zoom/Drag Canvas Horizontally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.8.4 Data -> Zoom/Drag Canvas Vertically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.8.5 Data -> Zoom in (Ctrl-+) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.8.6 Data -> Zoom out (Ctrl--) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.8.7 Data -> Select Data Range (Alt-S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.8.8 Data -> Data Reader (Ctrl-D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.9 Data -> Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.10 Data -> Screen Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.11 Data -> Vertical Cursor... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.12 Data -> Draw Data Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.13 Data -> Move Data points (Ctrl-Alt-M) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.8.14 Data -> Remove Bad Data Points (Alt-B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.8.15 Data -> Remove Bad Data Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9 The Analysis Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9.1 Commands for the analysis of data in tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9.1.1 Sort Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9.1.1.1 Ascending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9.1.1.2 Descending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.9.1.1.3 Custom... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.2 Sort Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.3 Normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.3.1 Normalize -> Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.3.2 Normalize -> Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.4 Differentiate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.5 Integrate... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.9.1.6 FFT... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.7 Correlate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.8 Autocorrelate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.9 Convolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.10 Deconvolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.11 Analysis -> Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.11.1 Fit Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.1.11.2 Fit Linear (Default) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
The QtiPlot Handbook xii

3.9.1.11.3 Multiple Linear Regression... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87


3.9.1.11.4 Fit Wizard... (Ctrl-Y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.9.2 Commands for the analysis of curves in plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.1 Translate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.1.1 Vertical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.1.2 Horizontal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.2 Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.2.1 Subtract -> Baseline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.2.2 Subtract -> Reference Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.2.2.3 Subtract -> Straight Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.3 Peaks... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.4 Differentiate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.5 Integrate... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.6 Integrate Function... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.7 Smooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.9.2.7.1 Savitski-Golay... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.9.2.7.2 Moving Window Average... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.9.2.7.3 Lowess... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.9.2.7.4 FFT Filter... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.9.2.8 FFT Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.9.2.8.1 Low Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.9.2.8.2 High Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.9.2.8.3 Band Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.9.2.8.4 Band Block... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.9.2.8.5 Math on Data Sets... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.9.2.8.6 Average Multiple Curves... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.9.2.8.7 Intersections... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.9.2.9 Interpolate... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.9.2.10 FFT... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11 Analysis -> Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.1 Fit Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.2 Fit Linear (Default) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.3 Fit Linear... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.4 Fit Polynomial... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.5 Fit Exponential Decay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.5.1 First Order... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.5.2 Second Order... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.5.3 Third Order... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.9.2.11.6 Fit Exponential Growth... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
The QtiPlot Handbook xiii

3.9.2.11.7 Fit Boltzmann (sigmoidal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96


3.9.2.11.8 Fit Pseudo-Voigt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.8.1 PsdVoigt1... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.8.2 PsdVoigt2... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.9 Fit Gaussian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.10 Fit Lorentzian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.11 Fit Multi-peak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.11.1 Gaussian... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.11.2 Lorentzian... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.11.3 PsdVoigt1... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.11.4 PsdVoigt2... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.9.2.11.12 Fit Wizard... (Ctrl-Y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3 Commands for the analysis of data in matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.1 Integrate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.2 FFT... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.3 Forward FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.4 Inverse FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.5 FFT Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.5.1 Low Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.5.2 High Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9.3.5.3 Band Pass... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.9.3.5.4 Band Block... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.10 The Statistics Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.10.1 Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.10.1.1 Statistics on Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.10.1.2 Statistics on Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.1.3 Frequency Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.1.4 Normality Test (Shapiro-Wilk)... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.2 Hypothesis-Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.2.1 One Sample t-Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.2.2 Two Sample t-Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.2.3 Chi-square Test for Variance... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.3 ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.3.1 One-Way ANOVA... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.3.2 Two-Way ANOVA... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.10.4 Nonparametric Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.1 One Sample Wilcoxon Signed Rank Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.2 Paired Sample Sign Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.3 Paired Sample Wilcoxon Signed Rank Test... . . . . . . . . . . . . . . . . . . . . . . . . . 100
The QtiPlot Handbook xiv

3.10.4.4 Kolmogorov-Smirnov Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100


3.10.4.5 Mann-Whitney Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.6 Kruskal-Wallis ANOVA... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.7 Mood’s Median Test... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.10.4.8 Friedman ANOVA... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.11 The Table Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.11.1 Set Column As . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.1 Set Column As -> X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.2 Set Column As -> Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.3 Set Column As -> Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.4 Set Column As -> X error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.5 Set Column As -> Y error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.6 Set Column As -> Read-only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.7 Set Column As -> Read/Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.8 Set Column As -> label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.1.9 Set Column As -> Disregard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.2 Column Options... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.11.3 Set Column Values... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.4 Recalculate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.5 Fill column with . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.5.1 Fill Column With -> Row Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.5.2 Fill Column With -> Random Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.5.3 Fill Column With -> Normal Random Numbers . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.6 Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.7 Add Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.8 Insert Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.9 Columns... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.11.10 Duplicate Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.11 Hide Selected Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.12 Show All Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.13 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.13.1 Alignment -> Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.13.2 Alignment -> Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.13.3 Alignment -> Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.14 Adjust Column Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.15 Move to First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.16 Move Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.17 Move Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.11.18 Move to Last . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
The QtiPlot Handbook xv

3.11.19 Swap columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104


3.11.20 Rows... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.21 Delete Rows Interval... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.22 Insert Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.23 Move Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.23.1 Move Row -> UP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.23.2 Move Row -> DOWN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.24 Go to Row... (Ctrl-Alt-G) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.11.25 Go to Column... (Ctrl-Alt-C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.26 Extract Data... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.27 Convert to Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.27.1 Convert to Matrix -> Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.27.2 Convert to Matrix -> 2D Binning... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.27.3 Convert to Matrix -> Regular XYZ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.11.27.4 Convert to Matrix -> Random XYZ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.12 The Matrix Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.12.1 Set Properties... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.12.2 Set Dimensions... (Ctrl-D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.3 Set Values... (Ctrl-Q) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.4 Recalculate (Ctrl-Return) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.5 Rotate 90 (Ctrl-Shift-R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.6 Rotate -90 (Ctrl-Alt-R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.7 Flip V (Ctrl-Shift-V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.8 Flip H (Ctrl-Shift-H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.9 Expand... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.10 Shrink... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.11 Smooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.12 Transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.12.13 Invert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.14 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.15 Go To Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.16 View Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.16.1 Image mode (Ctrl-Shift-I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.16.2 Data mode (Ctrl-Shift-D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.17 Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.17.1 Gray Scale Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.17.2 Rainbow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.17.3 Custom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
3.12.18 Show Column/Row (Ctrl-Shift-C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
The QtiPlot Handbook xvi

3.12.19 Show X/Y (Ctrl-Shift-X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107


3.12.20 Convert to Spreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13 The Format Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.1 Apply Template... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.2 Copy Format (Shift-F) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.3 Set As Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.4 Edit Range... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.5 Plot Associations... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.6 Plot... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.7 Curves... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.8 Scales... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.13.9 Axes... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.13.10 Grid... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.13.11 Title... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14 The Windows Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.1 Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.1.1 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.2 Cascade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.3 Tile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.4 Next (F5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.5 Previous (F6) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.14.6 Find... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.7 Rename Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.8 Copy Window (Shift-W) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.9 Duplicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.10 Script Window (F3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.11 Window Geometry... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.12 Hide Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.13 Close Window (Ctrl-W) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.14.14 Numbered Window List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.15 The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.15.1 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.15.2 Choose Help Folder... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.15.3 QtiPlot Homepage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.15.4 Download Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.15.5 Search for Updates... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.15.6 Changelog... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.15.7 About QtiPlot... (F1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.16 Customization of 3D plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
The QtiPlot Handbook xvii

3.16.1 Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112


3.16.2 Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.3 No axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.4 Front Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.5 Back Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.6 Left Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.7 Right Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.8 Ceiling Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.9 Floor Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.16.10 Enable perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.11 Reset rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.12 Fit frame to window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.13 Bars Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.14 Dots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.15 Cones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.16 Cross Hairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.17 3D Wire Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.18 3D Hidden Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.16.19 3D Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.16.20 3D Wire Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.16.21 Floor Data Projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.16.22 Floor Isolines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.16.23 Empty Floor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.16.24 Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

4 The Toolbars 115


4.1 The Edit Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.2 The File Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.3 The Plot Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.4 The Layers Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.5 The Table Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.6 The Column Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.7 The Plot 3D Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

5 The Dialogs 127


5.1 Folder Properties Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.2 Window Properties Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.3 Add Custom Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.4 Custom Color Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
The QtiPlot Handbook xviii

5.5 Set Equidistant Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129


5.6 Gradient Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.7 Add Error bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.8 Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5.9 Function 2D Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.10 Add Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.11 Add/Remove Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.12 Arrange Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.13 Graph Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.14 Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
5.14.1 Line Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
5.14.2 Arrow Head Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.14.3 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.14.4 Axes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.15 Reference Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.16 Image Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.16.1 Image Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.16.2 Frame Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5.16.3 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
5.17 Column Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.18 Plot Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.19 Edit Curve Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.20 Plot Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.20.1 Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.20.2 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.20.3 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.20.4 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.20.5 Window Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.20.6 Legends/Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.20.7 Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
5.20.8 Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.20.9 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.20.10 Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.20.11 Layer Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.20.12 Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.20.13 Group Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.20.14 Curve axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.20.15 Line/Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.20.16 Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
The QtiPlot Handbook xix

5.20.17 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162


5.20.18 Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.20.19 Error bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.20.20 Pie plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.20.21 Pie geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.20.22 Pie labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.20.23 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.20.24 Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.20.25 Percentile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.20.26 Outliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.20.27 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.20.28 Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.20.29 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.20.30 Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.20.31 Ridgeline Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.20.32 Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.20.33 Histogram Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.20.34 Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.20.35 Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
5.20.36 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5.20.37 Contour Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
5.20.38 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.21 Vertical Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5.22 Define surface plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.23 Export Graph Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5.24 Fast Fourier Transform Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.25 FFT Filter Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.26 Find Peaks Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
5.27 Frequency Count Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.28 Bland-Altman Plot Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.28.1 Data Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.28.1.1 Design 1: One data-pair per subject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.28.1.1.1 Confidence Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.28.1.2 Design 2: Repeated measurements for each method . . . . . . . . . . . . . . . . . . . . . . . 193
5.28.2 Lines Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.28.3 Output Settings Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.29 Q-Q Plot Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.30 Normality Test (Shapiro-Wilk) Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.31 One sample t-Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
The QtiPlot Handbook xx

5.32 Two sample t-Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197


5.33 Chi-square Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.34 One-way ANOVA Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.34.1 Post-hoc tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.35 Two-way ANOVA Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
5.35.1 Post-hoc tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5.36 Kruskal-Wallis ANOVA Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
5.37 Mood’s Median Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
5.38 Friedman ANOVA Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
5.39 One Sample Wilcoxon Signed Rank Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.40 Sign Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.41 Paired Sample Wilcoxon Signed Rank Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.42 Two Sample Kolmogorov-Smirnov Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.43 Mann-Whitney Test Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.44 Baseline Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
5.45 Math on Data Sets Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.46 Average Multiple Curves Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.47 Intersections Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.47.1 Rectangle Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.47.2 Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.47.3 Custom Output Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.48 Integration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.49 Integrate Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
5.50 Linear Fit Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.51 Polynomial Fit Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
5.52 Multiple Linear Regression Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
5.53 Fit Exponential Decay - First Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
5.54 Fit Exponential Decay - Second Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
5.55 Fit Exponential Decay - Third Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
5.56 Fit Exponential Growth Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
5.57 The Fit Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.57.1 Select Function Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.57.2 Fitting Session Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.57.3 Custom Output Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
5.57.3.1 Reported errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
5.57.3.2 Goodness-of-Fit Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
5.58 Help Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
5.59 General Plot Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
5.59.1 Scale Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
The QtiPlot Handbook xxi

5.59.2 Grid Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231


5.59.3 Axis Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
5.59.4 Special Ticks Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
5.59.5 General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
5.60 The Plot Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.61 Project Explorer Find Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
5.62 Preferences Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
5.62.1 General Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.62.1.1 Application Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.62.1.2 Confirmations Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.62.1.3 Colors Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
5.62.1.4 Numeric Format Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.62.1.5 File Locations Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
5.62.1.6 Keyboard Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
5.62.1.7 Internet Connections Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.62.2 Tables Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
5.62.2.1 Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
5.62.2.2 Descriptive Statistics Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
5.62.3 2D Plot Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.62.3.1 Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.62.3.2 Curves Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.62.3.3 Symbol Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.62.3.4 Error Bars Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.62.3.5 Axes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
5.62.3.6 Ticks Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.62.3.7 Grid Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.62.3.8 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.62.3.9 Speed Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5.62.3.10 Fonts Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
5.62.3.11 Print Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
5.62.4 3D Plot Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.62.4.1 Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.62.4.2 Curves Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.62.4.3 Axes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.62.4.4 Grids Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
5.62.4.5 Planes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
5.62.4.6 Colors Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
5.62.4.7 Fonts Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
5.62.5 Notes Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
The QtiPlot Handbook xxii

5.62.6 Fitting Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267


5.63 Serial Port Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
5.64 Serial Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
5.65 Printer-setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.66 Set Column Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
5.67 Extract Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.68 Set Matrix Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.69 Resample Matrix Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.70 Matrix Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
5.71 Set Matrix Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
5.72 Bin Matrix Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.73 Regular XYZ Gridding Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.74 Random XYZ Gridding Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
5.75 Surface plot options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
5.75.1 General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
5.75.2 Axes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
5.75.3 Grids Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
5.75.4 Planes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.75.5 Lighting Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
5.75.6 View Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
5.75.7 Stack Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.75.8 Scale Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
5.75.9 Axis Title Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
5.75.10 Axis Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
5.75.11 Grid Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
5.75.12 Text Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.75.13 Position Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.75.14 Legend Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
5.75.15 Color Scale Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
5.75.16 Axis Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
5.75.17 Title Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.75.18 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.75.19 Legend Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.75.20 Group Edit Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.75.21 Format Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
5.75.22 Colors Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.75.23 Projection Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.75.24 Labels Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
5.75.25 Drop Lines Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
The QtiPlot Handbook xxiii

5.75.26 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298


5.75.27 Normals Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
5.75.28 Offset Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
5.75.29 Vector Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.76 Sorting Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.77 Tex Equation Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.77.1 Text Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.77.2 Frame Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
5.77.3 Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.77.4 LaTeX Preamble Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.78 Text options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.78.1 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.78.2 Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.78.3 Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.79 Open Template Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.80 Export ASCII Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
5.81 Import ASCII files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
5.82 Convert files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.83 Import database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.84 Open Matlab File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.85 Open TDMS File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

6 Analysis of data and curves 318


6.1 Fast Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
6.2 Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
6.3 Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
6.4 Deconvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.5 Data Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.5.1 Fitting algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.5.2 Weighted data fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.5.3 Goodness-of-Fit Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.5.4 Confidence interval for the fit parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
6.5.5 Confidence bands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
6.5.6 Prediction bands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
6.6 Fitting to specific curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
6.6.1 Fitting to a line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
6.6.2 Fitting to a polynomial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.6.3 Fitting to a Boltzmann function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.6.4 Fitting to a Logistic function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
The QtiPlot Handbook xxiv

6.6.5 Fitting to a Gauss function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327


6.6.6 Fitting to a Lorentz function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
6.6.7 Fitting to a PsdVoigt1 function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
6.6.8 Fitting to a PsdVoigt2 function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
6.7 User defined fit models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
6.8 Multi-Peaks fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
6.9 Multiple Linear Regression Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
6.10 Filtering of data curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
6.10.1 FFT low pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
6.10.2 FFT high pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.10.3 FFT band pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
6.10.4 FFT block band filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
6.11 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

7 Mathematical Expressions and Scripting 339


7.1 muParser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
7.2 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
7.2.1 The Initialization File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
7.2.2 Python Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
7.2.3 Defining Functions and Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
7.2.4 Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
7.2.5 Accessing QtiPlot’s objects from Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
7.2.6 User settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
7.2.7 Project files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
7.2.8 Project folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
7.2.9 Working with Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
7.2.9.1 Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
7.2.9.2 Statistics on columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
7.2.9.3 Data searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
7.2.9.4 Data mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
7.2.9.5 Import ASCII files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
7.2.9.6 Importing Excel sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
7.2.9.7 Importing ODF spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
7.2.9.8 Export Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
7.2.9.9 NumPy interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
7.2.9.10 R interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
7.2.10 Linear Color Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
7.2.11 Working with Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
7.2.11.1 NumPy interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
The QtiPlot Handbook xxv

7.2.12 Table/Matrix conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365


7.2.13 Stem Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
7.2.14 2D Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
7.2.14.1 The plot title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
7.2.14.2 Customizing the axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
7.2.14.3 The canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
7.2.14.4 The layer frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
7.2.14.5 Customizing the grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
7.2.14.6 The plot legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
7.2.14.7 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
7.2.14.8 Resizing layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
7.2.14.9 Resizing the drawing area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
7.2.14.10 Working with 2D curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
7.2.14.11 Curve baseline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
7.2.14.12 Curve values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
7.2.14.13 Curve symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
7.2.14.14 Curve labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
7.2.14.15 Curve drop shadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.2.14.16 Selecting a data range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.2.14.17 Analytical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.2.14.18 Error Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
7.2.14.19 Image and Contour Line Plots (Spectrograms) . . . . . . . . . . . . . . . . . . . . . . . . . . 386
7.2.14.20 Analytical Spectrograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
7.2.14.21 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
7.2.14.22 Box and whiskers plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
7.2.14.23 Connecting percentile symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
7.2.14.24 Distribution Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
7.2.14.25 Curve Intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
7.2.14.26 Ridgeline plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
7.2.14.27 Pie Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
7.2.14.28 Doughnut Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
7.2.14.29 Vector Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
7.2.14.30 Adding arrows/lines to a plot layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
7.2.14.31 Reference lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
7.2.14.32 Adding images to a layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
7.2.14.33 Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
7.2.14.34 Circles/Ellipses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
7.2.14.35 Plot Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
7.2.14.36 Color Scale Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
The QtiPlot Handbook xxvi

7.2.14.37 Exporting graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402


7.2.14.38 Arranging Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
7.2.14.39 Waterfall Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
7.2.15 3D Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
7.2.15.1 Creating a 3D plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
7.2.15.2 Customizing the view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
7.2.15.3 Adding curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
7.2.15.4 Working with curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
7.2.15.5 Curve colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
7.2.15.6 Curve labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
7.2.15.7 Curve style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
7.2.15.8 Floor projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
7.2.15.9 Surface normals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
7.2.15.10 Curve symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
7.2.15.11 Drop Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
7.2.15.12 3D Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
7.2.15.13 Color Scale Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
7.2.15.14 3D Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
7.2.15.15 Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
7.2.15.16 The coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
7.2.15.17 The grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
7.2.15.18 The plot title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
7.2.15.19 Ading texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
7.2.15.20 3D Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
7.2.15.21 Exporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
7.2.16 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
7.2.16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
7.2.16.2 Analysis Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
7.2.16.3 Correlation, Convolution/Deconvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
7.2.16.4 Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
7.2.16.5 Pareto Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
7.2.16.6 Bland-Altman Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
7.2.16.7 Q-Q Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
7.2.16.8 FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
7.2.16.9 FFT Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
7.2.16.10 Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
7.2.16.11 Data Fit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
7.2.16.12 Muliple Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
7.2.16.13 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
The QtiPlot Handbook xxvii

7.2.16.14 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436


7.2.16.15 Average multiple curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
7.2.16.16 Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
7.2.16.17 Find Peaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
7.2.17 Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.2.17.1 Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.2.17.2 Hypothesis Testing - Student’s t-Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.2.17.3 One Sample Test for Variance (Chi-Square Test) . . . . . . . . . . . . . . . . . . . . . . . . . 440
7.2.17.4 Two Sample Kolmogorov-Smirnov Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
7.2.17.5 Kruskal-Wallis Anova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
7.2.17.6 Kruskal-Wallis Anova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
7.2.17.7 Mood’s Median Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.2.17.8 Mann-Whitney Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.2.17.9 One Sample Wilcoxon Signed Rank Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.2.17.10 Paired Sample Wilcoxon Signed Rank Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.2.17.11 Sign Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.2.17.12 Normality Test (Shapiro - Wilk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
7.2.17.13 One-Way ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
7.2.17.14 Two-Way ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
7.2.18 Working with Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.2.19 Using PyQt’s dialogs and classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.2.20 Using Qt Designer for easy creation of custom user dialogs . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.2.21 Task automation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
7.2.22 Scope Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.2.23 QtiPlot/Python API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
7.2.24 PyQt Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448

8 Acknowledgements 449
8.1 MPFIT: A MINPACK-1 Least Squares Fitting Library in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
8.1.1 Minpack Copyright Notice (1999) University of Chicago. All rights reserved . . . . . . . . . . . . . . . 449

9 Frequently asked questions 451

10 Index 452
The QtiPlot Handbook xxviii

List of Figures

1.1 Starting QtiPlot in French from a macOS terminal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2


1.2 A typical QtiPlot session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 The QtiPlot table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Working with Excel workbooks in QtiPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Context menu for Excel workbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 Properties dialog for Excel workbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 The QtiPlot matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.8 An example of QtiPlot 2D graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.9 The QtiPlot Note Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.10 The QtiPlot Results Log window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.11 The QtiPlot Project Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.12 The Quick Help Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.13 The Scripting Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.14 Export QtiPlot windows/projects as Origin C files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.15 OriginLab - Create new custom menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.16 OriginLab - New custom menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.17 OriginLab - New custom menu item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.18 OriginLab - Import script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.19 OriginLab - Select C file generated by QtiPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.1 A simple 2D plot: the table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18


2.2 A simple 2D plot: the default plot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 A simple 2D plot: the plot finished. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4 A 2D plot with two Y axes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5 Direct plot of a function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6 Function plot: filling of the X column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7 Function plot: filling of the Y column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.8 Example of a 3D Plots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.9 Definition of a new surface 3D plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.10 The 3D surface plot created using defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The QtiPlot Handbook xxix

2.11 The 3D surface plot after customization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.1 The result of the View Pixel Line Profile... command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43


3.2 Comparison of the curve smoothing methods available in QtiPlot applied to a simulated sine curve with added
white noise. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.3 The Smooth -> Savitsky-Golay... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.4 The Smooth -> Moving Window Average... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.5 The Smooth -> Lowess... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.6 The Smooth -> FFT Filter... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.7 The FFT Filter -> Low Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.8 The FFT Filter -> High Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.9 The FFT Filter -> Band Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.10 The FFT Filter -> Band Block... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.11 The Interpolate... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

4.1 The QtiPlot Edit Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115


4.2 The QtiPlot File Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.3 The QtiPlot Plot Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.4 The QtiPlot Layers Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.5 The QtiPlot Table Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.6 The QtiPlot Column Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4.7 The QtiPlot Plot 3D Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

5.1 The folder properties dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127


5.2 The Rename Window dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.3 The Add Custom Script Action... dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.4 The Custom Color Map dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5.5 Set Equidistant Levels dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.6 The One Color mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.7 The Two Colors mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.8 The Three Colors mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.9 The Custom Color Map mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.10 The Palette mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.11 The Colormap files mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.12 Example of a plot with both X and Y Error Bars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5.13 The Add Function... dialog box: Cartesian Coordinates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
5.14 The Add Function... Dialog Box: Automatic Detection of Constants. . . . . . . . . . . . . . . . . . . . . . . . 134
5.15 The Add Function... dialog box: Parametric Coordinates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5.16 The Add Function... dialog box: Polar Coordinates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5.17 The Function 2D dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
The QtiPlot Handbook xxx

5.18 The Add Layer Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136


5.19 The Add/Remove Curves... Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.20 The Add/Remove Curves... dialog box for 3D plot windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.21 The Arrange Layers... dialog: the Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
5.22 Example of a vertical arrangement for two plots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.23 The Graph Manipulation dialog used for extracting individual layers from 2D graph windows. . . . . . . . . . . 140
5.24 The Graph Manipulation dialog used for merging 2D graph windows. . . . . . . . . . . . . . . . . . . . . . . . 141
5.25 The Arrow Options Dialog: Line Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.26 The Arrow Options Dialog: Arrow Head Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.27 The Arrow Options Dialog: Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.28 The Arrow Options Dialog: Axes Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.29 The reference Line Options dialog for Value-based lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.30 The reference Line Options dialog for Statistics-based lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.31 The Image Options Dialog: Image Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5.32 The Image Options Dialog: Frame Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
5.33 The Image Options Dialog: Geometry Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.34 The Column Options... Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.35 The Plot Associations Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.36 The Edit Curve Range Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.37 The Plot Details Dialog: Dimensions tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.38 The Plot Details Dialog: Print tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.39 The Plot Details Dialog: Fonts tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.40 The Plot Details Dialog: Miscellaneous tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.41 The Plot Details Dialog: Display tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.42 The Plot Details Dialog: Legends/Titles tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
5.43 The Plot Details Dialog: Layer properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.44 The Plot Details Dialog: Canvas with a solid background color. . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.45 The Plot Details Dialog: Canvas with a background image. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.46 The Plot Details Dialog: Canvas geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.47 The Plot Details Dialog: Layer Speed Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.48 The Plot Details Dialog: Layer Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.49 The Plot Details Dialog: Layer Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.50 The Plot Details Dialog: Group Edit tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5.51 Context menu of a plot layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5.52 The Plot Details Dialog: Assign Axes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.53 The Plot Details Dialog: Line formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.54 The Plot Details Dialog: Standard Symbol formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.55 The Plot Details Dialog: Unicode Symbol formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5.56 The Plot Details Dialog: Image Symbol formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
The QtiPlot Handbook xxxi

5.57 The Plot Details Dialog: Labels formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163


5.58 The Plot Details Dialog: Offset formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.59 The Plot Details Dialog for formatting error bars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.60 The Plot Details Dialog for pies: Pie Segment Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.61 The Plot Details Dialog for pies: Pie Geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.62 The Plot Details Dialog for pies: Pie Labels Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.63 The Plot Details Dialog for pies: Pie Colors Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.64 The Plot Details Dialog for box and hiskers formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.65 The Plot Details Dialog for box: Percentile Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.66 The Plot Details Dialog for outliers and extreme values formatting. . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.67 The Plot Details Dialog for box: Data Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.68 The Plot Details Dialog: distribution options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.69 The Plot Details Dialog for box: lines options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.70 The Plot Details Dialog for box: connect options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.71 The Plot Details Dialog: ridgeline display options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.72 The Plot Details Dialog for Column, Bar and Histogram curves: Spacing tab. . . . . . . . . . . . . . . . . . . . 172
5.73 The Plot Details Dialog for Box curves: Spacing tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.74 The Plot Details Dialog for histograms: Data Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.75 The Plot Details Dialog for Vector XYXY curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.76 The Plot Details Dialog for Vector XYAM curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.77 The Values tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
5.78 The Colors tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5.79 Set Equidistant Levels dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.80 The Two Colors mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.81 The Custom Color Map mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.82 The Palette mode of the Gradient Fill dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.83 The Contour Lines tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.84 The Plot Details Dialog for curve analysis operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.85 Context menu for a Lorentz data fit analysis operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5.86 The Vertical Cursor... dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.87 The New -> New Function Plot -> New 3D Surface Plot... dialog box. . . . . . . . . . . . . . . . . . . . . . . 182
5.88 The New -> New Function Plot -> New 3D Surface Plot... dialog box. . . . . . . . . . . . . . . . . . . . . . . 182
5.89 The FFT... dialog box for a curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.90 The FFT... dialog box for a table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.91 The FFT... dialog box for a matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.92 The FFT Filter -> Low Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.93 The FFT Filter -> High Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.94 The FFT Filter -> Band Pass... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.95 The FFT Filter -> Band Block... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
The QtiPlot Handbook xxxii

5.96 The FFT Filter Dialog dialog box for a matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
5.97 The Find Peaks dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.98 The Frequency Count dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.99 Bland-Altman Plot... dialog: Data tab for single measurements. . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.100Bland-Altman Plot... dialog: Data tab with Subject column for repeated measurements. . . . . . . . . . . . . . 193
5.101Bland-Altman Plot... dialog: Lines tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.102Bland-Altman Plot... dialog: Output Settings tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.103The Frequency Count dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.104The Normality Test (Shapiro-Wilk) dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.105One sample t-Test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5.106Two sample t-Test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
5.107The Chi-square Test for Variance dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.108The one-way ANOVA dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.109The two-way ANOVA dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5.110The Kruskal-Wallis ANOVA dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
5.111The Mood’s median test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
5.112The Friedman ANOVA dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.113The one sample Wilcoxon signed rank test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.114The paired sample sign test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.115The paired sample Wilcoxon signed rank test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.116The two sample Kolmogorov-Smirnov test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.117The two sample Mann-Whitney test dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.118The Math on Data Sets dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.119The Average Multiple Curves dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.120The Intersections Dialog: Rectangle tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.121The Intersections Dialog: Options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.122The Intersections Dialog: Custom Output tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.123The Integration Options dialog box for curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.124The Integration Options dialog box for tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
5.125The Integrate Function... dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
5.126The Linear Fit Options dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.127The Polynomial Fit Options dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
5.128The Multiple Linear Regression dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
5.129The Fit Exponential Decay options dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
5.130The Fit Exponential Decay Second Order dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
5.131The Fit Exponential Decay Third Order dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
5.132The Fit Exponential Growth options dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
5.133The first step of the Fit Wizard... dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.134The Fit Wizard... dialog box: providing initial guesses for the fit parameters. . . . . . . . . . . . . . . . . . . . 226
The QtiPlot Handbook xxxiii

5.135The Fit Wizard... dialog box: choosing the input data set(s). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
5.136The Fit Wizard... dialog box: choosing the fit algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
5.137The third step of the Fit Wizard... dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
5.138Help browser window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
5.139General plot options dialog: The Scale Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
5.140General plot options dialog: The Grid Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
5.141General plot options dialog: The Axis Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
5.142General plot options dialog: The Special Ticks Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
5.143General plot options dialog: General Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.144The plot wizard dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
5.145The project explorer find dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
5.146The preferences dialog: general parameters for the application. . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.147The Preferences dialog: Confirmations tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
5.148The Preferences dialog: Colors tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.149The Preferences dialog: Numeric Format tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
5.150The preferences dialog: File Locations Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
5.151The preferences dialog: Keyboard Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.152The preferences dialog: Internet Connection Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
5.153The Preferences dialog: table options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.154The Preferences dialog: descriptive statistics options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
5.155The preferences dialog: 2D plot options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.156The Preferences dialog: Curves Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.157The Preferences dialog: Symbol Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.158The Preferences dialog: Error Bars Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
5.159The Preferences dialog: Axes Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.160The Preferences dialog: Ticks Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.161The Preferences dialog: Grid Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.162The Preferences dialog: Geometry Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5.163The Preferences dialog: Speed Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
5.164The Preferences dialog: Fonts Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
5.165The Preferences dialog: Print Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.166The preferences dialog: 3D plot options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.167The Preferences dialog: 3D curves tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
5.168The Preferences dialog: 3D axes tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.169The Preferences dialog: 3D grids tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
5.170The Preferences dialog: 3D planes tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
5.171The Preferences dialog: 3D colors tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
5.172The Preferences dialog: 3D fonts tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
5.173The preferences dialog: note options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
The QtiPlot Handbook xxxiv

5.174The preferences dialog: fitting options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268


5.175The Serial Port Settings dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
5.176The Serial Monitor Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
5.177The Print dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.178The Set Column Values... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
5.179The Extract Data... dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.180The Set Dimensions... dialog for matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.181The Resample Matrix Dialog dialog for a matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.182The Set Properties... dialog for matrices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
5.183The Set Values... dialog for matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
5.184The Bin Matrix Dialog dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.185Scatter plot showing the number the data points falling within each 2D bin. . . . . . . . . . . . . . . . . . . . . 277
5.186The Regular XYZ Gridding dialog box: XY data grid preview. . . . . . . . . . . . . . . . . . . . . . . . . . . 278
5.187The Regular XYZ Gridding dialog box: 3D surface preview. . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
5.188The Shepard’s interpolation method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
5.189The Random XYZ Gridding dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
5.190The general 3D plot options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
5.191The general 3D plot axes tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
5.192The general 3D plot grids tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.193The general 3D plot planes tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.194The general 3D plot lighting tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
5.195The general 3D plot view tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.196The general 3D plot stack tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.197The surface plot options dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
5.198The 3D color scale tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
5.199The 3D color scale axis tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.200The 3D color scale title tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.201The 3D color scale geometry tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.202The 3D legend tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.203The 3D legend tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
5.204The 3D bars/symbols offset tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.205The 3D Vector options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.206The Sorting Options Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.207The Tex Equation Editor: using a rendering web service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.208The Tex Equation Editor: using the built-in LaTeX parser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
5.209The Tex Equation Editor: compilation of complete LaTeX documents. . . . . . . . . . . . . . . . . . . . . . . . 302
5.210The Tex Equation Editor: LaTeX preamble tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.211The axis title options dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
5.212The legend/text options dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
The QtiPlot Handbook xxxv

5.213The legend frame options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308


5.214The legend symbol options tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.215Opening of a QtiPlot Window Template (.qwt) file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
5.216Export of a selection from a table to an ASCII file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
5.217The dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
5.218Convert OPJU files dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.219SQL database table/view selection with query dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.220Database table/view selection dialog on Linux and macOS systems. . . . . . . . . . . . . . . . . . . . . . . . . 314
5.221The Open Matlab File dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.222The Matlab variable properties dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
5.223The Open TDMS File dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
5.224The TDMS channel properties dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

6.1 An example of the FFT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318


6.2 An example of a correlation between two sine functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
6.3 The results shown in the log window after a data fit operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.4 The results of a Fit Linear (Default). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
6.5 The results of Fit Polynomial.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.6 The results of Fit Boltzmann (sigmoidal). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.7 The results of Fit Logistic compared to Fit Boltzmann (sigmoidal). . . . . . . . . . . . . . . . . . . . . . . . . 327
6.8 The results of Fit Gaussian. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
6.9 The results of Fit Lorentzian. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
6.10 The results of Fit Pseudo-Voigt -> PsdVoigt2.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
6.11 The results of a non-linear fit using a custom Gauss function: y(x) = A*exp(-(x-xc)ˆ2/(2*wˆ2)). . . . . . . . . . . 331
6.12 The results of a Fit Multi-peak -> Lorentzian.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
6.13 Information dialog allowing to launch the Fit Wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
6.14 Signal after a FFT low pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
6.15 Signal after a FFT high pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.16 Signal after a FFT band pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
6.17 Signal after a FFT block band filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
6.18 Comparison of the three methods of interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
The QtiPlot Handbook xxxvi

List of Tables

4.1 Edit toolbar commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116


4.2 File toolbar commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.3 New Window/Folder Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.4 New Function/Surface Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.5 Open Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.6 Plot toolbar commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.7 Plot Toolbar Zoom Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.8 Read Data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.9 Edit Data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.10 Add Text Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.11 Add Line/Arrow Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.12 Geometric Shape Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.13 Image Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.14 Z-order Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.15 Align Objects Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.16 Layers toolbar commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.17 Add Layer Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.18 Add Axis Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.19 Fit Layers Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.20 Extract/Merge Layers Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.21 Table toolbar commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.22 Line Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.23 Scatter Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.24 Line & Symbol Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.25 Bar Chart Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.26 Statistical Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.27 Vector Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.28 Special Line/Symbol Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.29 3D Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.30 Column toolbar commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
The QtiPlot Handbook xxxvii

4.31 3D Plot toolbar commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

5.1 Syntax specifiers for the components of a box chart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.1 muParser: Predefined Fundamental Physical Constants in the standard MKSA unit system . . . . . . . . . . . . 339
7.2 muParser: Supported Mathematical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
7.3 muParser: Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
7.4 muParser: Other functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
7.5 Python: Supported Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Abstract

This document is a handbook for using QtiPlot, a program for two- and three-dimensional graphical presentation of data sets and
for data analysis.
This manual is organized in several chapters:
-The first chapter describes the main concepts and terms which are used in QtiPlot.
-The second chapter is a tutorial on how to obtain plots from different data sets. It is the one you need to read first to understand
the basics of QtiPlot and to be able to draw plots.
-The three following chapters are descriptions of all the commands, buttons and dialogs used in QtiPlot. These chapters are the
reference manual of QtiPlot.
- The two following chapters describe more deeply some specific possibilities of QtiPlot, that is the statistical and mathematical
analysis of data, and the scripting.
The QtiPlot Handbook 1 / 452

Chapter 1

Introduction

1.1 What QtiPlot does

QtiPlot is a program for two- and three-dimensional graphical presentation of data sets and for data analysis. Plots can be
produced from data sets stored in tables or from analytical functions.
QtiPlot is a dynamic tool: Plots created from data sets, and the tables owning that data, are interconnected. When any table is
modified, all objects in dependent plots (curves, axes scales, legends) are automatically updated. For example, deleting a table,
or perhaps only some of the columns, will automatically remove all the corresponding curves from dependent plots. Plots can be
exported in several graphic formats (eg: jpeg, png, bmp, pdf, etc) and inserted as images in documents or presentations.
All settings for a complete set of tables, matrices and plots can be saved in a project file having the extension ".qti". These project
files may be opened using the command line, the File menu, or by using the Open project icon from the File toolbar.
Data analysis operations (integration, interpolation, FFT, curve fitting, etc.) can be performed on the curves in a 2D plot via the
Analysis menu. The results of all these operations are also stored in the project file. They can be visualized at any time using the
Results log and can be deleted from the project file via the Clear Log Information command.
When the application is launched, a new untitled project file is created consisting of a grey main window (the workspace) which
may initially contain an empty child window, depending on your preferences. The type of this initial child window can be
customized using the Preferences dialog. It may be a table, a matrix, a note or an empty 2D graph window. In order to be
operational, the workspace must be populated with at least one data container. Either empty tables or matrices may be created
manually (New Table command) and then filled with data, or they may created by importing ASCII files (Import -> Import
ASCII... command), which automatically creates new tables.
The user can easily navigate through the objects of a project file by using either the project explorer or the Windows menu. The
project explorer also allows the user to perform various operations on the windows (tables and plots) in the workspace: hiding,
minimizing, closing, renaming, printing, etc.

1.2 Command Line Parameters

1.2.1 Specify a File

When starting QtiPlot from the command prompt, you can supply the name of a project file:
qtiplot file_name.qti

Other file formats are also accepted: .opj, .ogm, .ogw, .ogg for Origin projects, .qti, qti.gz for QtiPlot projects, .xls, .xlsx for Excel
workbooks, .ods, .fods for Open Document Format Spreadsheets, .mat for Matlab files, .tdms for LabVIEW TDM Streaming
(TDMS) file format, .db, .dbf, .mdb, .accdb for dBase, MySQL, SQLite and Microsoft Access databases and all the image file
formats (raster or vectorial) that can be read by QtiPlot.
The name can also refer to an ASCII file:
The QtiPlot Handbook 2 / 452

qtiplot ASCII_file_name

In this latter case, a new "untitled" project will be created, containing a table or matrix with the ASCII data from the file. The file
is read and interpreted using the current settings from the Import -> Import ASCII... command dialog.

Figure 1.1: Starting QtiPlot in French from a macOS terminal.

1.2.2 Command Line Options

Valid options are:

• -a or --about: show about dialog and exit


• -c or --console: show standalone scripting window
• -d or --default-settings: start QtiPlot with the default settings
• -h or --help: show command line options
• -l=XX or --lang=XX: start QtiPlot in language XX (’en’, ’fr’, ’de’, ...)
• -m or --manual: show QtiPlot manual in a standalone window
• -v or --version: print QtiPlot version and release date
• -x or --execute: execute the script file given as argument
• -X: execute the script file given as argument without displaying the user interface. Warning: 2D plots are not correctly handled
in this mode!

If the file_name refers to a Python script and you use one of the following options: -c (--console), -x (--execute) or -X, you can
also enter a list of arguments for the script, like in the example bellow:
qtiplot -c -x /Users/ion/Desktop/hello.py Luca 3

where ’Luca’ and ’3’ are the arguments for the script ’hello.py’ to be loaded and executed.
QtiPlot will insert an automatically generated header before your actual script:
import sys
sys.path.append(’/Users/ion/Desktop’)
sys.argv=[’/Users/ion/Desktop/hello.py’,’Luca’,’3’]
### End of QtiPlot generated header ###

This way the list of arguments is made available to your script. Also, the script path is appended to the execution path, so that
you can import other scripts from that folder.
When you save the script, the QtiPlot generated header is removed so that your original script is not modified in any way, provided
that you do not delete the commented line.
The QtiPlot Handbook 3 / 452

1.3 General Concepts and Terms

Several plots and all the data related to these plots can be saved in a project file. The project is therefore the main container of
QtiPlot. The following screenshot gives an example of a typical session. This example shows the log panel at the top of the
workspace, the project explorer at the bottom, plus a table and a plot window. Other windows are either docked or hidden.

Figure 1.2: A typical QtiPlot session

General note on MDI style windows. QtiPlot uses a Multiple Document Interface (MDI) style for its sub-windows (for example
graph and table windows, etc.). This is a convenient mechanism for placing sub-windows on a single parent window (the project
window). Such collections of windows are then handled as a group when dragging or minimizing the main window. However,
the behavior of maximized sub-windows is one feature of the MDI interface that may cause some confusion at first. As would
be expected, sub-windows maximize to the size of the main window’s workspace rather than to the size of the screen, but
the default for maximized sub-windows is to have no title bar. As a consequence, there are no control boxes attached to the
The QtiPlot Handbook 4 / 452

window, leaving the (incorrect) impression that once maximized, control boxes can no longer be used to minimize, normalize or
close the sub-window. However, control boxes for a maximized sub-window are still present, they have just been moved to the
extreme right hand side of the main window’s menu bar. Since only one sub-window can be maximized at a time, there is no
ambiguity regarding which sub-window this set of control boxes will operate upon. Finally, as a reminder of which sub-window
is maximized, the Name and label of the maximized sub-window are appended to main window’s title as:
"QtiPlot - ProjectName - [WindowName - WindowLabel]"
There are numerous commands available in QtiPlot. The specific subset of commands available depends on the element which
is selected. Therefore, the main menu bar changes when you select a particular element of the project. Moreover, you can access
the set of commands relevant to a given element by activating the context menu with the right button of the mouse when the
mouse pointer is floating over the chosen element.
In a project, the containers which can be used are:

A Table A table is a spreadsheet like object which can be used to store the data you are entering. The table is contained in its
own window (the Table Window). It can be used to perform some calculations and statistical analysis of that data. In each
table, columns can be labeled as X-values or Y-values for 2D-plotting, or Z-values if you plan to build a 3D-plot.
A table can be created using the New Table command. There are then several ways to fill the table with data. If you
want to read your data from an ASCII file, you can import it from the file into a table using the Import -> Import ASCII...
command. You can also manually enter each value from the keyboard. Finally, you can fill the table with the results of
evaluating a mathematical function using the (Set Column Values... command from the Table menu)
An Excel Workbook On Windows operating systems where Microsoft Excel is available you can create an Excel workbook as
an OLE instance in QtiPlot workspace. Excel workbooks can be created using the New Excel command and are managed
as a special type of QtiPlot child windows. They can be controlled via their context menu (right click on the window
title bar to make it pop-up). All QtiPlot window functions (save, copy, duplicate, export, print, hide, close, etc...) can be
reached via this menu.
A Matrix A matrix is a special table which is used to store the data points for surface 3D plots. It contains Z-values and doesn’t
include any column or row which could be designed as X-values or Y-values. Nevertheless, you can specify the X-values
and the Y-values with the Set Dimensions... command from the Matrix menu.
A matrix is created using the New Matrix command. If you want to read matrix data from an ASCII file, you can import
the data from the file into a table using the Import -> Import ASCII... command, and then convert this table to a matrix
with the Convert to Matrix. In the same way as for tables, you can also fill a matrix with the results of evaluating a function
z=(i,j) in which i and j are row and column numbers (Set Values... command from the Matrix menu)
A Graph A graph can contain one or several layers. A layer consists of axes, text items, graphics, and a single plotting area
bounded by the axes lines. One or more curves, generated from data or functions, are placed into the plotting area to create
a plot. Layers and their contained plots can be arranged in many ways to build matrix of plots. Throughout this document,
the term plot window is used as a synonym for a graph.
A new layer can be added to an existing graph with the Add Layer from the Graph menu. you can also remove an existing
layer with the Remove Layer, but if you remove a layer, the plot on that layer will also be deleted. You can also copy a
layer from one graph to another, or copy an existing graph into another (the window will be added as a new layer - see the
section on Multilayer Plots for more details).
Curves can be added to a plot in several ways. You can select data from tables or matrices to generate the curve, or, create
a curve from a function of one or two variables (see sections 2D plots and 3D plots).
A Note This window is a text container which can simply be used to insert comments into a project, but is really far more
powerful than that. It can be used as a calculator, for executing single commands, and for writing scripts.
The Results Log Window This window is used to store the results of all calculations which have been done. If this window is
not visible, you can find it with the Project Explorer or with the Results log.
The text in the log window is also saved in the project file, so that when you load a previously saved project, the results-log
panel is re-filled with the results of previous calculations.
The Project Explorer This window is used to list all the windows contained in a project. The Project Explorer gives quick
access to all elements of a project, hidden or visible. It can be used to perform some operations on the listed windows such
as hiding a window, renaming a window, etc.
The QtiPlot Handbook 5 / 452

A project file can include several independent projects. In this case, the containers of each project are stored in different
folders.
The Quick Help Window This window is used to display the help pages available in the documentation for the main dialogs in
QtiPlot. It can be opened using the Quick Help command from the View menu or by a click on the Help button available
in any of the QtiPlot dialogs that support the quick help system.
The Scripting Console This window is mainly used to display error messages during the execution of Python scripts launched
from note windows. It can be opened/closed using the Console command from the View menu.

1.3.1 Tables

When working with data, tables are the main focus of QtiPlot. Fundamentally, a table is simplified spreadsheet contained in a
Window which can be used to control, edit, and convert data. Tables are also highly customizable: all colors and font preferences
can be set using the Preferences... command of the View menu, and you can resize a table in terms of rows and columns using
the Table menu with Rows or Columns.

Figure 1.3: The QtiPlot table

Every column of a table has a label, and can be assigned a format: numeric, text, date or time. Each column can also have one
of the following flags set: X, Y, Z, X-error, Y-error, label, or none (i.e., a simple column without any special flag). X flagged
columns are the abscissae while Y flagged columns are the ordinates used when creating a 2D plot from data. A column must
have either the X or Y flag set to be available for use in a 2D plot. The X-error and Y-error columns can be used to add error bars
to a curve in a 2D plot. Flags can be changed using the Column options dialog. To reach this dialog, simply double-click on the
column label or use the Column Options... command from the Table menu.
A table column is selected by left clicking on it’s label. Multiple columns are selected in one of 2 ways. First, if the columns are
adjacent, it is most convenient to left click on the first desired column’s label and, while holding the left mouse button down, drag
The QtiPlot Handbook 6 / 452

the mouse pointer over the labels of the column you wish to select. Second, in the case where desired columns are not adjacent,
you can select additional columns by keeping the Ctrl key pressed while left clicking on the desired column’s label. This also
allows you to deselect specific columns. You can select all the columns of a selected table by pressing (Ctrl+A).
You can perform various operations on selected columns : fill with data, normalize, sort, view statistics and finally, generate
curves from your data. All these functions can be reached by right clicking on the column label or by using the Table menu.
All other table functions: rename, duplicate, export, print, and close can be reached via the context menu (right click anywhere
in the table outside the column labels area).
You can cut, copy and paste data between tables or between a table and another application (Excel, Gnumeric, etc.).
You can import single or multiple ASCII files using the Import -> Import ASCII... command from the File menu. Of course you
can also export the data from a table to a text file using the Export ASCII dialog.

1.3.2 Excel workbooks

Excel workbooks are available only on Windows operating systems if Microsoft Excel is installed. An Excel workbook can be
created using the New Excel command. You can also open an Excel file as an OLE instance in QtiPlot workspace if the Import
Excel files using method defined in the General tab of the Preferences dialog is set to New Excel. Excel files can be opened
through the Open Excel command from the File menu or you can directly drag-and-drop them into the QtiPlot workspace.
When an Excel workbook is created in QtiPlot, a window type oriented menu called Excel will be available in the menu bar of the
application. From this menu you can perform various operations with the data in the workbook: you can convert a data selection
or entire worksheets to QtiPlot tables or export data to ASCII files. You can also convert Excel charts to QtiPlot graph windows
or export them as image files. Only the image file formats supported by Excel can be chosen for this last operation.

Figure 1.4: Working with Excel workbooks in QtiPlot


The QtiPlot Handbook 7 / 452

The Excel workbook is managed as a special type of QtiPlot child window which can be controlled via its context menu (right
click on the window title bar to make it pop-up). All QtiPlot window functions (save, copy, duplicate, export, print, hide, close,
etc...) can be reached via this menu.

Figure 1.5: Context menu for Excel workbooks

Excel specific options can be customised via the Properties dialog. The workbook can be saved as an external Excel file linked
to the project or as an internal object in the QtiPlot project. If you choose to save it as an external link it is beneficial to save the
Excel file in the same folder as the QtiPlot project or in a subfolder under it and then set Excel file path relative to QtiPlot project
path to make them more portable.

Figure 1.6: Properties dialog for Excel workbooks

You can cut, copy and paste data between QtiPlot tables and Excel workbooks. Please note that when copying data from Excel
The QtiPlot Handbook 8 / 452

workbooks QtiPlot will only copy the number of digits displayed in Excel rather than the full precision values.
You can also make QtiPlot plots directly from data in an embedded Excel workbook, by selecting the data range and then opening
the Plot menu and choosing a graph type, but the available graph types are largely limited especially for 3D graphs.

1.3.3 Matrix

The matrix is a special table which is used for data which depends on two variables. This special table can be used to create
3D plots as well as 2D image/contour plots via the Plot 3D menu and the 3D plot toolbar. One difference between a table
and a matrix is that matrices may function in one of two modes: they can display data in table form or they can display an
image. Therefore matrices can be used as a basic image viewer and also as an image editor, since they implement some image
manipulation functions like: 90 degrees rotation, horizontal and vertical mirroring, etc.
In a matrix there is no special column nor special row for X or Y labels or values. Nevertheless, you can specify an X-scale and
a Y-scale with the Set Dimensions....

Figure 1.7: The QtiPlot matrix

The values which are stored in a matrix can be generated from a function of the form z=f(i, j, x, y) with the Set Values...
command, i and j being the column and row numbers and x and y the corresponding coordinates. They can also be read directly
from an ASCII file with the Import -> Import ASCII... command or from an image file.

1.3.4 Plot Window

The plot window (that is, a graph), provides a container for plotting data. It contains one or more layers, which are the main
containers of a graph. Each layer contains a plotting area into which curves are placed when creating a plot. Each layer has
its own geometry and graphic properties (background color, frame, etc). The example presented below shows a graph with two
layers which have different geometries.
The QtiPlot Handbook 9 / 452

Figure 1.8: An example of QtiPlot 2D graph

Each layer can be activated by clicking on its corresponding gray button in the top-left corner of the window.
Some graph elements can be accessed by a double click on an element in a layer. These are:

• the graph itself: this will open the Custom Curve Dialog. You can then add new curves to the plot, or change the way the
curves are plotted.

• The axes or the axes labels: this will open the General Plot Options Dialog. It is used to customize the axes, the numbers and
labels of the axes, and the grid.
• Text items, including the legend: this will open the Text Options Dialog which allows customizing the font of the label and the
frame in which it is drawn.

• Arrow/Line items: this will open the Line Options Dialog.


• Image items: this will open the Image Options Dialog allowing to customize the geometry and the position of the image.

A left click on a layer element selects it. You can deselect any element by pressing the Escape key. A right click on a layer
element pops-up a context menu allowing quick access to its properties dialog. Last but not least, you should know that QtiPlot
provides multiple selection for objects in a layer. In order to add an object to an existing selection keep the Shift key pressed and
click on the element you want to add to the selection. Elements in a multiple selection can be moved and resized together with
the mouse.

1.3.5 Note

A note can simply be used to insert text (comments, notes, etc) into a project, but is really far more powerful than that. It can
be used as a calculator, for executing single commands and for writing scripts. Evaluation of mathematical expressions and
execution of code is done via a note’s context menu, the Scripting menu or convenient keyboard shortcuts. For information on
expression syntax, supported mathematical functions and how to write scripts, see here.
The QtiPlot Handbook 10 / 452

Figure 1.9: The QtiPlot Note Window

Note windows provide powerful text editor functionalities, particularly helpful when writing scripts: customizable Python syntax
highlighting, line number display, find and replace text, and autocompletion suggestions for words having more than two charac-
ters. You can manually trigger autocompletion by using Ctrl+U. The colors used for syntax highlighting can be customized via
the Notes tab in the Preferences dialog.

1.3.6 Results Log Window

This window keeps a history of all analysis which has been done in the project. It panel contains the results of all the correlations,
fittings, etc.

Figure 1.10: The QtiPlot Results Log window


The QtiPlot Handbook 11 / 452

1.3.7 The Project Explorer

The project explorer can be opened/closed using the Project Explorer from the View menu or by clicking on the in the file
toolbar.

Figure 1.11: The QtiPlot Project Explorer

It gives an overview of the structure of a project and allows the user to perform various operations on the windows (tables, graphs,
and notes) in the workspace: hiding, minimizing, closing, renaming, printing, etc. These functions can be reached via the context
menu, obtained by right-clicking on an item in the explorer. When the cursor is moved over a graph or matrix item name a
256x256 preview of the window is displayed.
By double-clicking on an item, the corresponding window is shown maximized in the workspace, even if it was hidden before.
From the project explorer window, different objects can be organized into folders. When selecting a folder, the default policy is
that only the objects contained in it will be shown in the workspace window. You can also display all the objects in subfolders if
you change this policy with the "View Windows" command to "Windows in Active Folder and Subfolders".

1.3.8 The Quick Help Window

This window can be opened/closed using the Quick Help command from the View menu or by a click on the Help button available
in any of the QtiPlot dialogs that support the quick help system.

Figure 1.12: The Quick Help Window


The QtiPlot Handbook 12 / 452

The main purpose of the quick help window is to display the help pages available in the QtiPlot documentation. It also implements
some of the basic functionalities of a help browser: searching for user defined words in the documentation (with the help of the
and buttons), as well as quick navigation through the recent viewing history (using the and buttons).

1.3.9 The Scripting Console

This window can be opened/closed using the Console command from the View menu. QtiPlot opens it automatically in order to
display error messages during the execution of Python scripts launched from note windows.

Figure 1.13: The Scripting Console

1.4 Interoperability with other scientific software

QtiPlot can import and export data from and to several scientific programs: OriginLab, Excel and other major office suites
like LibreOffice and Apache OpenOffice. It can also import Matlab files, LabVIEW TDMS files, dBase, MySQL, SQLite and
Microsoft Access databases. Last but not least easy integration with LaTeX typesetting system is also available.

1.4.1 OriginLab

1.4.1.1 Import of OriginLab projects

QtiPlot can import *.opj project files created with OriginLab versions ranging from 3.5 to 9.9.5 (Origin 2022b). QtiPlot can also
import old version format files (*.ORG), individual workbooks (*.ogw files), matrices (*.ogg files) and graphs (*.ogg files).
The *.OPJU file format introduced in Origin 2018 is only supported on Windows, provided that a recent OriginLab version is
installed on your computer (even as an evaluation or demo version). In this case QtiPlot can use the COM interface installed by
OriginLab in order to automatically convert the .opju files to the older .opj file format, which, afterwards, it tries to import.
Please beware that not all of OriginLab features are available in QtiPlot and that sometimes the formating of the data tables or of
the plot windows might look different from the original projects.

1.4.1.2 Export QtiPlot projects to OriginLab

Starting with version 0.9.9.1 QtiPlot can also export individual project windows, projects folders or entire projects as Origin C
files that can be compiled and executed by OriginLab. Again, since not all of OriginLab features are available in QtiPlot the data
tables and especially the plot windows might look different when opened into OriginLab.
Saving QtiPlot projects to Origin C files is straightforward: open the File menu, select the Save Window as... or Save Project
as... command and choose the file type Origin project (*.c) from the file dialog.
If you export projects containing 2D graph windows that display images or LaTeX equations QtiPlot will save all these images
into a folder with the -images suffix appended to the base name of the exported Origin C file. Therefore if you send the .c file to
someone else don’t forget to also attach this folder.
The QtiPlot Handbook 13 / 452

Figure 1.14: Export QtiPlot windows/projects as Origin C files

There are a few preparatory steps that should be undertaken into OriginLab in order to easily open the C files generated by
QtiPlot. First of all you should create a new menu using the OriginLab Custom Menu Organizer wizard from the Tools menu:

Figure 1.15: OriginLab - Create new custom menu

In the Custom Menu Organizer dialog you need to right click into the left panel in order to add a new menu, that was renamed to
CustomImport in the example screenshot bellow:
The QtiPlot Handbook 14 / 452

Figure 1.16: OriginLab - New custom menu

Next you need to right click on this new menu and from the popup menu select the option Add Item:

Figure 1.17: OriginLab - New custom menu item

Once the menu item is created you need to select it with the mouse. A new dialog page appears and you can customize it like in
the following screenshot, where we changed the default name to Open QtiPlot and added a Status Bar Text:
The QtiPlot Handbook 15 / 452

Figure 1.18: OriginLab - Import script

In the LabTalk Script editor you must copy/paste the following code lines:
run.LoadOC(Originlab\\image_utils.c);
getfile *.c;
if (run.LoadOC(%A) == 0) importQtiPlot;

Once this is done click the Close button of the dialog and press the Yes button when asked to save the changes.
In order to be successfully compiled by OriginLab the C files generated by QtiPlot must be copied into the OriginC folder of
your OriginLab installation directory, like shown in the screenshot bellow:
The QtiPlot Handbook 16 / 452

Figure 1.19: OriginLab - Select C file generated by QtiPlot

After the compilation process OriginLab will create a new folder having the base name of the imported C file.

1.4.2 Microsoft Excel

1.4.2.1 Import of Excel files

QtiPlot can import data from spreadsheets stored in binary *.xls, *xlsx files as well as from *.xml Microsoft Excel files, using
different methods. For more details see the Open Excel command.
On Windows operating systems, if Microsoft Excel is installed on your computer, QtiPlot can also import the charts from Excel
files or even embed Excel workbooks (New Excel command).

1.4.2.2 Export QtiPlot data to Excel

QtiPlot can export data from table and matrix windows as binary *.xls files.

1.4.3 LibreOffice and Apache OpenOffice

1.4.3.1 Import

QtiPlot can import data from spreadsheets stored in binary *.ods files as well as from flat XML *.fods files (see Open ODF
Spreadsheet command).

1.4.3.2 Export

QtiPlot can export data from table and matrix windows as binary *.ods files if either LibreOffice or Apache OpenOffice are
installed on your computer.
The QtiPlot Handbook 17 / 452

Chapter 2

Drawing plots with QtiPlot

2.1 2D plots

A 2D plot is based on curves which are defined by Y values as functions of X values. There are two ways to obtain a 2D plot
depending on the way the (X,Y) values are defined:

• You can have your (X,Y) values in a table. You need to select at least one column as X values and one column as Y values.
This is specified using the "Plot Designation" option found in the Column Options... command. Then you select the columns
and use one of the commands in the Plot menu to plot the data.
• If you want to plot a function, you don’t need a table at all. You can plot the function directly with the New Function Plot...
command. This opens the corresponding dialog box where you define the mathematical expression of your function.

• These two methods can be combined by first defining a table, and then filling it with the results of evaluating your function.
This is done with the Set Column Values... command. Then you select the columns and use one of the commands from the
Plot menu to plot the data.

In each of these cases, QtiPlot will create a new graph with the plotted curve placed on a new layer. Data plots and function plots
can also be added to an existing layer using either the New Function Plot... command command or by right clicking within the
area of the desired plot to pop up the plot’s Graph Menu, and then selecting Add...Add Function.
Once the plot is created, you can customize all the graphic items in the plot using commands from the Format Menu. You can
add new items (text labels, lines or arrows, new legend, images) to the plot with the commands of the Graph Menu.

2.1.1 2D plot from data.

The data must be stored in a table. There are two methods for inserting your (X,Y) values into the table: you can type them
directly from the keyboard, or you can read them from a file. Here we will use the first solution, refer to the Import -> Import
ASCII... command to use the second.
The first step in this example is to create an empty project with the New Project command from the File menu. You can also use
the Ctrl-N key or the icon from the File toolbar. Next create a new table using the New Table command from the File menu,
the Ctrl-T key, or the icon from the File toolbar.
A newly created table has two columns (one for X and one for Y) and 30 rows. You can add rows and columns by selecting a
row or a column and using the right mouse button. You can also modify the number of rows and columns with the Rows and
Columns from the Table menu. Try setting the number of rows to 7, which will match the table shown below. Then enter the
values as shown (you can of course use your own data). You should now have this table:
The QtiPlot Handbook 18 / 452

Figure 2.1: A simple 2D plot: the table.

You must next select the data to be plotted. To select the 2 columns of data just entered, left click on the title of first column and
drag the mouse pointer over to the title of the second column while holding the left mouse button down. Now, with the columns
selected, you can build the plot (here a simple 2D scatter) with the Scatter command from the context menu, or by clicking on
the corresponding icon from the Plot toolbar or with the Scatter command from the Plot menu. A plot is created in the plotting
area of a new layer on a new graph. Default options are used for for all newly created elements. You can customize the default
options with the preferences dialog. The default options will produce the following:

Figure 2.2: A simple 2D plot: the default plot.

You can now customize your plot and the elements of the parent layer. Double clicking on any point will open the Custom curves
dialog, which is used to modify the plotted symbols. A double-click on any axis opens the general plot options dialog, where you
can change scales, fonts for the axis labels, etc. You can also add grid lines on X or Y axes, etc. Finally, a double click on any
text item (X title, Y title, plot title) allows you to change the text and its presentation. As an illustration, several changes have
been made to the above plot. The final result is:
The QtiPlot Handbook 19 / 452

Figure 2.3: A simple 2D plot: the plot finished.

Finally, you should save your project in a ’.qti’ file using the Save Project command from the File menu or by typing the Ctrl-S
key, or by clicking the icon from the File toolbar. Depending on your needs, you can export the plot in any of several standard
image file formats using the Export Graph -> Current command from the File menu, or by entering the Alt-G key.
There are several types of curves which can be plotted from a table. They are presented in the Plot menu
It is possible to use up to four axes for the data:

Figure 2.4: A 2D plot with two Y axes.


The QtiPlot Handbook 20 / 452

In addition to the customizations which have been already been described, for the figure above the axes used for each curve were
defined using the Custom Curves Dialog, and two arrows were added with the Draw Arrow. Note that the table must be modified
by the addition of a second column of Y data before the second curve can be drawn in the plotting area (using Graph Menu, and
then selecting Add...Add/Remove Curve).

2.1.2 2D plot from function.

There are two ways to obtain such a plot: you can plot a function directly, or fill a table with the values calculated from a function
and create the plot in the usual way.

2.1.2.1 Direct plot of a function.

If you just want to plot a function, you can use the New Function Plot... command from the File menu, click the icon in the
File toolbar, or simply enter Ctrl-F.
This command will open the Add Function Curve dialog. You can then enter the mathematical expression of your function, the
X range to be used for the plot, and the number of points in the X range. Besides classical Y=f(X) functions, you can also define
parametric and polar functions.
The QtiPlot Handbook 21 / 452

Figure 2.5: Direct plot of a function.

2.1.2.2 Filling of a table with the values of a function.

If you want to work not only with the plot but also with the resulting data, create a new table as explained in the previous section.
Then fill this table with the values of the function evaluation using the Set Column Values... command.
Let’s obtain the same plot as in the previous example. Create a new table (key Ctrl-T), select the first column and use the Set
Column Values... command either from the context menu, or the Table menu. The row number can be used in functions by
referencing the row number symbol, i. For a range of 0.01-30 in 300 steps (0.01 per step) enter the function expression i/10 and
use 300 rows. (Note that since row numbering starts at 1, to actually get the X range used in the last example (0-30 over 300
points), we would need to define the function expression as (i-1)*30/299.)

Figure 2.6: Function plot: filling of the X column.

The second step is to select the second (Y) column and use the Set Column Values... command to set up the function. The
expression is a function of the X values (that is the first column) which is named col(1). Enter sin(col("1"))+cos(col("1")/3+1)
as the function and click apply to generate the values in the Y column.
The QtiPlot Handbook 22 / 452

Figure 2.7: Function plot: filling of the Y column.

Once the table is ready, you just have to build the plot as explained in the previous section.

2.2 3D plots

3D plots are generated from data defined as Z=f(X,Y). As with 2D plots, there are two ways to obtain a 3D plot, depending on
the way the (X,Y,Z) values are defined:

• You can have your Z values in a matrix. QtiPlot will consider that all the data present in the matrix are Z values, and the X and
Y values are defined as functions of the column and row numbers.
The data in the matrix can be entered in several ways:
– one by one from the keyboard,
– by reading an ASCII file into a table and converting the table into a matrix,
– by setting the values with a function.

• If you want to plot a function, you don’t need a matrix. You can plot a function directly using the New 3D Surface Plot...
command. This will open the corresponding dialog box where you define the mathematical expression of your function.

There are several kinds of 3D plots which can be selected, see the Plot 3D menu section of the reference chapter for a list of the
available plots.
The QtiPlot Handbook 23 / 452

Figure 2.8: Example of a 3D Plots.

3D plots use OpenGL so you can easily rotate, scale and shift them with the mouse. Using the 3D plot settings dialog or the
Surface 3D Toolbar, you can change all the predefined settings of a three dimensional plot: grids, scales, axes, title, legend and
colors for the different elements.
There are several types of plots which can be built from a matrix. They are presented in the Plot 3D menu

2.2.1 Direct 3D plot from a function

This is the simplest way to obtain a 3d plot. Use the New 3D Surface Plot... command from the File menu or simply enter
Ctrl-Alt-Z. This will open the following dialog box:

Figure 2.9: Definition of a new surface 3D plot


The QtiPlot Handbook 24 / 452

You can enter the function z=f(x,y) and the ranges for X, Y and Z. Then QtiPlot will create a default 3d plot:

Figure 2.10: The 3D surface plot created using defaults

You can then customize the plot by opening the Surface plot options dialog. You can modify the axis ranges and parameters, add
a title, change the colors of the different items, and modify the aspect ratio of the plot. In addition, you can use the commands of
the 3D plot toolbar to add grids on the walls or to modify the style of the plot. The following plot illustrates some of the possible
modifications:

Figure 2.11: The 3D surface plot after customization.

If you want to modify the function itself, you can use the surface... command which can be activated from the context menu
The QtiPlot Handbook 25 / 452

with a right click on the 3D plot. This will re-open the define surface function dialog box.

2.2.2 3D plot from a matrix

The second way to obtain a 3D plot is to use a matrix. Therefore, the first step is to fill the matrix. This can be done by evaluation
of a function.
The New Matrix command create a default empty matrix with 32x32 cells. Then use the Set Dimensions... to modify the number
of rows and columns of the matrix. This dialog box is also used to define the X and Y ranges.

Then use the Set Values... command to fill the cells with numbers. The ranges of X and Y defined in the previous step are not
known by this dialog box, so the function must be defined with row and column numbers (i and j) as parameters (see the section
set-values for details).
The other way to obtain a matrix is to import an ASCII file into a table with the Import -> Import ASCII... command from the
File menu. The table can then be transformed into a matrix with the Convert to Matrix from the Table menu.
You can then use this matrix to build a 3D plot with one of the commands from the Plot menu.

2.3 Multilayer Plots

Graph windows can contain multiple layers, each with different characteristics. Each layer has a corresponding, numbered
button. A button appears pressed when its layer is the currently active layer. Only one layer is active at a time, and the plot tools
(zoom, cursors, drawing tools, delete and move points) only operate on this layer. A layer is made active by clicking on it or on
its corresponding button.
To arrange layers use the Arrange Layers... dialog. You can add or remove layers with the Add Layer and Remove Layer or
copy/paste layers from one multilayer window to another. All these functions can be reached via the Graph menu, by using the
Plot toolbar or via the context menu (right click in the multilayer window anywhere outside a layer area).
You can resize and move a layer using the Layer geometry dialog (Select the Geometry tab in Plot... from the Format Menu).
You can also arrange and resize layers by hand using the mouse. First, select the layer to be modified or moved and then select
the layer’s plot area by left clicking on a border line (an axis line) of the plot area. QtiPlot will draw a box outlining the plot area
with drag handles at the corners and midpoints of the sides. The cursor will assume a shape based upon where it is located on the
layer: a hand shape when inside the plot area, or a double ended arrow when over one of the drag handles. The cursor’s function,
which is invoked by pressing the left mouse button, is indicated by this shape.
The QtiPlot Handbook 26 / 452

Pressing and holding the left mouse button when the cursor assumes the hand shape allows dragging the entire layer with the
mouse. Releasing the mouse button will drop the layer at the new position. Pressing and holding the left mouse button when the
cursor assumes one of the double ended arrow shapes allows dragging the corresponding border of the plot area, scaling the layer
as needed. Releasing the mouse button will drop the border and apply the new scale value. Grabbing a midpoint handle moves
only the corresponding border, while grabbing a corner handle allows simultaneous dragging of both corresponding borders.
Dragging the corner handles does not preserve the aspect ratio of the layer.
You can also conveniently resize a layer using the mouse wheel in combination with either the Ctrl, Alt, or Shift keys. In order
to use the mouse wheel, the desired layer must be selected, either by clicking in the layer or by using one of the layer selection
buttons. It is not necessary to have the plot area selected, although the wheel functions will work in either case. The wheel
functions work as follows: Pressing and holding the Ctrl key while rotating the wheel resizes the height, pressing and holding
the Alt key while rotating the wheel resizes the width, pressing and holding the Shift key while rotating the wheel resizes both
the height and width. Note that in this last case (Shift+Wheel), the aspect ratio of the layer is preserved.

2.3.1 Building a multilayer plot panel

This is the simplest way to obtain a multilayer plot. It can be used if you want to build a panel of plots with a simple arrangement:
2 plot in a row or in a column, or 4 plots in 2 rows and 2 columns.
You can select two columns with Y-values in a table, and then use one of the Panel commands in the Plot menu. QtiPlot will
create a panel of plots in which the size of the different elements of each plot are synchronized.

You can then customize the plots. If you want to change the arrangement of the panel, use the Arrange Layers... from the Graph
menu. In this case, keep in mind that each plot is in its own layer whose surface area is one half or one quarter of the window’s
surface area. So, if you want to share an element between two plots (for example a text label), you need to add it in a new layer
(see the Add Text for more details).

2.3.2 Building a multilayer plot step by step

If you need to build a more complex multilayer plot, you can define it step by step.
The first step is to build your first plot (for example from two columns of a table). Start by creating a standard graph window:
The QtiPlot Handbook 27 / 452

Then, select the plot window and use the Add Layer from the Graph menu. This will activate the Add Layer dialog. If you
choose "Guess" you will obtain a panel with two columns, if you choose "corner" you will obtain two superposed layers, you
can then modify these two layers.

If you want to build a panel with two rows, you can use the Arrange Layers... to automatically rearrange the layers.
The QtiPlot Handbook 28 / 452

Then select the second (empty) plot and use the Add/Remove Curves... command to select the Y-values from one of the tables
of the project.

After this, you can customize your plot. At the end, the modifications done on the axis or on the axis labels may have modified
the geometry of the two plots. You can again rearrange the two plots by using the Arrange Layers... a second time.
The QtiPlot Handbook 29 / 452
The QtiPlot Handbook 30 / 452

Chapter 3

Command Reference

The active items appearing in a menu depends upon which project window is active. For example, if the active window is a table,
then all the items related to table functions are enabled and the others are automatically disabled.

3.1 The File Menu

Many of the commands from the File Menu are also linked to corresponding icons in the File Toolbar. Clicking one of these
icons will directly execute the linked command.

3.1.1 File-> New ->

3.1.1.1 New -> New Project (Ctrl-N)

Creates a new QtiPlot project file. If another project is already open and has been saved at least once, it will be closed before the
new project is created. If another project is open but has never been saved, a dialog will be opened to ask if the current project
should be saved.

3.1.1.2 New -> New Folder (F7)

Adds a new folder to the project. The new folder is added to the current folder.

3.1.1.3 New -> New Table (Ctrl-T)

Creates a new (empty) table and adds it to the project. The empty table will have 30 rows and 2 columns. The number of rows
and columns can be changed with the Rows and Columns of the Table menu.

The properties of each column (numeric format, column width, etc) can be modified using the Column Options... command of
the Table menu. See the table section for more details.
The QtiPlot Handbook 31 / 452

3.1.1.4 New -> New Excel

Creates a new (empty) Excel workbook as an OLE instance in QtiPlot workspace and adds it to the project. This function only
works on Windows operating systems where Microsoft Excel is available. See the Excel section for more details.

3.1.1.5 New -> New Matrix (Ctrl-M)

Creates a new (empty) Matrix and adds it to the project. The empty matrix will have 32x32 cells. These dimensions can be
changed using the Set Dimensions... of the Matrix menu

See the matrix section for more details.

3.1.1.6 New -> New Note

Creates a new note window and adds it to the project. A note is a simple text window which can be used to add comments to the
current project.
The QtiPlot Handbook 32 / 452

3.1.1.7 New -> New Graph (Ctrl-G)

Creates a new 2D plot, that is, a graph window with a single, empty layer, and adds it to the project. Current defaults are used to
create the layer, which is just a framework into which you add curves with the Add/Remove Curves... command.

3.1.1.8 New -> New Function Plot -> New Function Plot... (Ctrl-F)

Opens a dialog which is used to create a 2D plot by specifying an analytical function. See the 2D plot section of the tutorial for
a general overview of this function.
The function can be defined in Cartesian, parametric or polar coordinates, see the Add Function... command for more details.
The QtiPlot Handbook 33 / 452

3.1.1.9 New -> New Function Plot -> New Parametric Function Plot...

Opens the parametric coordinates tab of the add function dialog which is used to create a 2D plot by specifying two parametrical
functions: X=f1(m) and Y=f2(m).

3.1.1.10 New -> New Function Plot -> New Function 2D... (Ctrl-2)

Opens the Function 2D dialog which is used to create a new 2D image/contour plot from an analytical function of two variables
(x and y).

3.1.1.11 New -> New Function Plot -> New 3D Surface Plot... (Ctrl-Alt-Z)

Opens a dialog which is used to create a 3D plot by specifying an analytical function. Only Cartesian coordinates are available.
See the 3D plot section of the tutorial for more detail on this function.

3.1.1.12 New -> New Function Plot -> New 3D Parametric Surface Plot...

Opens the parametric coordinates tab of the surface dialog which is used to create a 3D plot by specifying the (X,Y,Z) data points
as functions of the latitude and longitude variables u and v. Only Cartesian coordinates are available.

3.1.2 File-> Recent Projects

Opens a list of the most recently used QtiPlot project files. You can open one of these files by selecting it from the list. If the file
no longer exists or has been moved, an error message will pop-up and the filename will be deleted from the list.

3.1.3 File -> Open (Ctrl-O)

Opens an existing QtiPlot project file (.qti). If your project has been saved in a compressed format, you must select the .qti.gz
file format.
This command can also be used to open projects which have been built with Origin software.

3.1.4 File -> Open Excel

Opens a file dialog permitting you to select an Excel file. When a file is selected and opened, QtiPlot creates a new table for
each sheet in the file and reads the spreadsheets into the tables. Depending on the operating system QtiPlot provides three import
methods. The first one (using the ExcelFormat library) can fail for certain files, therefore QtiPlot provides a second solution
which needs either OpenOffice or LibreOffice installed on your computer. On Windows platforms, if the file contains graphs,
QtiPlot will also import them, but only if you have Excel installed on your machine. The import method used by QtiPlot can be
set via the General tab of the Preferences dialog.

3.1.5 File -> Open ODF Spreadsheet

Opens a file dialog permitting you to select an OpenOffice spreadsheet file. QtiPlot can import data from spreadsheets stored in
binary *.ods files as well as from flat XML *.fods files. When a file is selected and opened, QtiPlot creates a new table for each
sheet in the file and reads the spreadsheets into the tables.

3.1.6 File-> Open Image File (Ctrl-I)

This command adds a new graph window to the QtiPlot project and loads an image file into it. The image can be resized and
moved around in the graph window if desired. It can also be copied and inserted into another 2D plot with a result similar to that
obtained using the Add Image. An image can also be used to generate an intensity matrix (see the Import Image... command).
The QtiPlot Handbook 34 / 452

3.1.7 File -> Append Project... (Ctrl-Alt-A)

Appends an existing QtiPlot project file (.qti) to the current project as a new folder.
This command can also be used to append projects which have been built with Origin software.

3.1.8 File -> Close

Closes current project, without quitting the application.

3.1.9 File-> Convert files...

Opens the Convert files dialog that can be used in order to convert OriginLab *.opju projects to the older file format *.opj.
This menu action is only available on Windows operating systems, provided that a recent OriginLab version is installed on your
computer (even as an evaluation or demo version).

3.1.10 File-> Save Project (Ctrl-S)

Saves the current project. If the project hasn’t been saved yet (an "untitled" project), a dialog will open, allowing you to save the
project to a specific location. In a project file, all settings and all plots are stored in ASCII format.
If the project includes large tables, it may be useful to save the project in a compressed file format. The free zlib library is used
to save files in gzip format ( .qti.gz ).

3.1.11 File-> Save Project as... (Ctrl-Shift-S)

Saves the current project under a file name different than the current name.

3.1.12 File-> Save Window as...

The Save Window as... command allows you to save tables and graphs from from one Qti project into a newly created project
file. The command opens a standard file-save window in which you select the new project’s name and location. Projects may
be saved in either compressed or uncompressed form. If a graph window is selected, the new project will contain the graph and
it’s associated tables/matrices. If a table, matrix or note is chosen, the new project will contain only the selected table, matrix or
note. In this case, dependent graphs are not included in the new project.

3.1.13 File -> Open Template

Can be used in order to import an existing QtiPlot XML template file (.qwt) or the older template file formats: .qpt (2D graphs),
.qst (3D graphs), .qmt (matrices), .qtt (tables) as well as some OriginLab window template file formats: .otp (2D graphs) and
.otm (matrices).
This command opens the Open Template Dialog that can be used in order to create, for example, a new graph window with one
or more empty layers created using the same graphical parameters (window geometry, fonts, colors, etc). as the layers in the
saved template.

The first figure below is a graph which was saved as a template. The second figure is the graph with a new, empty layer created
using the Open Template command to load the saved template file.
The QtiPlot Handbook 35 / 452

You just have to add curves with the Add/Remove Curves... command, but note that the style used to draw these curves is not
kept in the template.

3.1.14 File -> Save as Template

Save the active graph as a QtiPlot template file (.qpt). The resulting template will contain all of the layers from the graph,
including images, text labels (axes, etc), and any graphical parameters, including the positions and sizes of the layers. Plotted
data, the style used to draw curves, and any associated scales are not saved in the template.

3.1.15 File-> Print (Ctrl-P)

Prints the active plot. A print dialog is opened where you can select the printer, different paper sizes, etc.

3.1.16 File-> Print Preview

Displays a print preview for the active window. You can use this dialog to print the previewed window.

3.1.17 File-> Print All Plots

Prints all plots in the project. A print dialog is opened where you can select the printer, different paper sizes, etc.
The QtiPlot Handbook 36 / 452

3.1.18 File -> Export Graph

The Export Graph command appears in the file menu whenever a graph window is selected. This command opens the Export
Graph dialog which can be used in order to save the active graph window in a chosen image format.

3.1.18.1 Export Graph -> Current (Alt-G)

This selection will save the active graph using one of the image formats supported by QtiPlot.

3.1.18.2 Export Graph -> All (Alt-X)

This selection will save all graphs in the project using one of the image formats supported by QtiPlot.

3.1.18.3 File -> Create Open Document Presentation...

This selection will save all the graphs in the project in an Open Document Format file (.odf) that can be opened and edited with
OpenOffice.

3.1.19 File -> Export

The Export command appears in the file menu whenever a non-graph window (i.e., Table or Matrix) is selected.

3.1.19.1 Export ASCII

This command opens the Export ASCII dialog, with which you can save the active table or matrix in a chosen ASCII format
(".dat", ".html", ".odf", ".tex", ".txt", and ".xls" are available).

3.1.19.2 Export Excel

This command opens the Export ASCII dialog with the ".xls" format pre-selected. This saves the active table or matrix as an
Excel spreadsheet.

3.1.19.3 Export to PDF (Ctrl-Alt-P)

This command opens a generic file dialog to save the active window as a PDF document.

3.1.20 File -> Import

3.1.20.1 File -> Import -> Import ASCII... (Ctrl-K)

Opens the Import dialog used to import ASCII data files. The file to import, and the options for importation are set in this dialog.

3.1.20.2 File-> Import Image...

Using this command, an image may be loaded into a QtiPlot project and converted into an intensity matrix. For each pixel, an
intensity between 0 and 255 is computed from the intensities of the three colors red, green and blue.
The QtiPlot Handbook 37 / 452

This example shows the 3D plot drawn from the intensity matrix obtained from the QtiPlot logo.

3.1.20.3 File -> Import -> Database...

This command opens a sub-menu allowing to import database files in one of the following formats: dBase (.dbf), Microsoft
Access (.mdb, .accdb), SQLite (.db), MySQL and PostgreSQL.
If you wish to import Microsoft Access database files (.mdb, .accdb) on Windows you must first install the Microsoft Access
Database Engine available for download from the following link: https://www.microsoft.com/en-us/download/details.aspx?id=13255.
You must, of course, pay attention to the architecture of your Windows system and install the 64-bit version of the Access
Database driver if you’re using a 64-bit version of QtiPlot.
Each of the commands in the database format sub-menu opens a file dialog or a server connection dialog allowing the selection
of a database. After the completion of the database selection step, depending on the database format, QtiPlot might also open a
table selection dialog allowing to choose the tables/views to be imported. If you choose to import an SQL database (MySQL,
PostgreSQL or SQLite), this dialog also makes possible to perform an SQL query prior to the import operation.

3.1.20.4 File -> Import -> Matlab...

This command allows to import Matlab (.mat) files. It opens the Open Matlab File dialog that gives total control over the import
process.

3.1.20.5 File -> Import -> Sound (WAV)...

This command allows you to import an uncompressed sound (.wav) file (PCM format).

3.1.20.6 File -> Import -> NI (TDMS)...

This command allows to import files in the TDMS format (.tdms), a file format developed by National Instruments which is
optimized for saving measurement data to disk. This command opens the Open TDMS File dialog that gives total control over
the import process.

3.1.21 File -> Quit (Ctrl-Q)

Closes the application. You will be asked whether or not you want to save any changes.
The QtiPlot Handbook 38 / 452

3.2 The Edit Menu

3.2.1 Edit -> Undo (Ctrl-Z)

Undo the last change.

3.2.2 Edit -> Redo (Ctrl-Shift-Z)

Reverse the effect of the last "Undo" operation.

3.2.3 Edit -> Cut Selection (Ctrl-X)

While this command does not currently appear in the Edit Menu, the functionality is provided with the Ctrl-X key. The command
copies the current selection to the clipboard and deletes the selection.

3.2.4 Edit -> Copy Selection (Ctrl-C)

Copies the current selection to the clipboard.

3.2.5 Edit -> Copy Selection (full precision)

Copies the current selection to the clipboard with maximum numeric precision. Only available for tables and matrices.

3.2.6 Edit -> Delete Selection (Del)

Removes the current selection from the project.

3.2.7 Paste ->

Selecting Paste -> opens up a sub-menu of additional commands for specialized paste operations.

3.2.7.1 Paste -> Paste Selection (Ctrl-V)

Pastes the content of the clipboard to the active window.

3.2.7.2 Paste -> Transpose (Ctrl-Alt-T)

Transposes the text from the clipboard and pastes it to the active window. This command is only enabled if there is text available
in the clipboard and is not enabled for 2D and 3D plot windows.

3.2.7.3 Paste -> Paste Format (Ctrl-Shift-V)

Pastes the format from a 2D or 3D plot window (copied using the Copy Format command) to the active window. This command
is enabled only for 2D and 3D plot windows.
The QtiPlot Handbook 39 / 452

3.2.8 Edit -> Delete Fit Tables

Each time you fit your data to some mathematical model, a new table is created in which to put the results of the fit (i.e. the
values computed by the model). These tables can be used to plot comparisons of experimental and fitted values. If you have
completed several tentative fits, a number of fit result tables may be present in your project. This command allows you to remove
the results of all the different fits that you have tested.

3.2.9 Edit -> Clear Log Information

Allows the user to clear the log panel. All history information about analyses performed by the user will be deleted from the
project file. The log panel will then be empty.

3.2.10 Edit -> Preferences...

Opens the Preferences dialog.

3.3 The View Menu

3.3.1 View -> Toolbars... (Ctrl-Shift-T)

Opens a pop-up menu allowing you to enable/disable tool bars.

3.3.2 View -> Project Explorer (Ctrl-E)

Opens/Closes the Project Explorer dock window, which gives an overview of the structure of a project and allows the user to
perform various operations on the windows (tables and plots) in the workspace.

3.3.3 View -> Results log

Opens/Closes a panel displaying a history of all data analysis operations performed by the user.

3.3.4 View -> Undo/Redo Stack...

Shows/Hides the matrix Undo/Redo Stack window. The Undo/Redo stack contains the history of editing changes for a selected
matrix. When any matrix is selected, its Undo/Redo information will be copied into this window. If another matrix is selected, the
data for that matrix will be swapped into the list. Only one matrix can have it’s Undo/Redo information showing at a time. The
depth of the stack (i.e., number of possible undo steps) is set in the "Applications" tab in the "General" section of the Preferences
dialog. Each list entry consists of the name of the matrix followed by the identity of the cell that was edited. Each edit pushes
another entry onto the list. The current position in the Undo/Redo history is highlighted. Undo (Ctrl-Z or ) or Redo (Ctrl-Shift-
Z or ) will move the highlight as appropriate. The history can be rapidly traversed by clicking on a stack entry, which will move
the highlight to the clicked entry and revert the matrix to that point in the history. Each time the project is saved, the save-project
icon ( ) is placed next to the stack entry that was highlighted at the time of the file save operation. This serves as a reminder to
the user of exactly what version of the matrix resides on disk.

3.3.5 View -> Quick Help

Opens/Closes a window displaying the QtiPlot documentation pages.


The QtiPlot Handbook 40 / 452

3.3.6 View -> Console

Shows/Hides the scripting console window.

3.3.7 View -> Serial Monitor...

Opens a serial monitor window allowing to read/write data from/to available serial ports.

3.4 The Scripting Menu

3.4.1 General Scripting Commands

These are commands that always appear in the Scripting menu, regardless of the window type selected

3.4.1.1 Scripting -> Scripting language

Opens a dialog used to select the scripting language for the current project.

3.4.1.2 Scripting -> Restart scripting

Reinitializes the scripting environment.

3.4.1.3 Scripting -> Add Custom Script Action...

Opens the Custom Action dialog, which allows you to define menu items and toolbar buttons that launch Python scripts.

3.4.2 Notes Specific Scripting Commands

If the active window in the project is a Notes window, the following additional items will also be available in the scripting menu:

3.4.2.1 Scripting -> Execute (Ctrl+J)

Executes the line where the mouse cursor is placed in the Notes window.

3.4.2.2 Scripting -> Preferences... (Ctrl+Shift+J)

Executes all lines in the Notes window.

3.4.2.3 Scripting -> Evaluate (Ctrl+Return)

Evaluates the line where the mouse cursor is placed in the Notes window.

3.4.2.4 Rename Tab...

Opens a standard dialog which permits changing the name of the active notes tab.
The QtiPlot Handbook 41 / 452

3.4.2.5 Add Tab

Adds a new tab to the active notes window. The new tab will be named untitled by default. The tab may be renamed at any time
using the Rename Tab... command.

3.4.2.6 Close Tab

Closes (deletes) the active Notes tab. The contents of the tab will be lost. No warning is given!

3.5 The Graph Menu

This menu is only active (visible) when a graph window is selected.

3.5.1 Graph -> Add/Remove Curves... (Alt-C)

Opens the Add/Remove Curves... dialog, allowing easy addition or removal of curves from the active plot layer. This dialog can
also be used to modify a curve which is already plotted by changing the columns which are used as X or Y values. The curve is
added to the currently active layer. If there is no layer on the graph, an error message will pop-up.

3.5.2 Graph -> Add Error Bars... (Ctrl-B)

Opens the Add Error Bars... dialog. You can add error bars to X and/or Y values on an existing plot. Error bars are added to the
currently active layer.

3.5.3 Graph -> Add Function... (Ctrl-Alt-F)

Opens the Add Function... dialog. This command is used to add new function curves to an existing layer. New curves are added
to the currently active layer.

3.5.4 Graph -> Add Function 2D... (Ctrl-Alt-2)

Opens the Function 2D dialog. This command is used to add new two variable functions to an existing layer as image/contour
plots.

3.5.5 Graph -> Rescale To Show All (Ctrl-Shift-R)

Rescales the active plot layer after a zoom operation so that all data on the graph is visible. This command does not set any
special mode of its own, but unlike the Zoom out command, it does not alter any other mode that may be in effect. Nevertheless,
it does delete the zoom history of the rescaled plot.

3.5.6 Graph -> Exchange X-Y Axes

This command is used to swap the X and Y axes of the active plot layer. It remains checked until the axes are exchanged back to
their initial state by a second call of this command.

3.5.7 Graph -> New Legend (Ctrl-L)

Adds a new legend object to the active layer. You can have more than one legend on a plot. These legends can later be customized
by double clicking on a given legend.
The QtiPlot Handbook 42 / 452

3.5.8 Graph -> New Table...

Adds a new table object to the active layer. These tables are only provided for data presentation purposes, they cannot be used
as data source for plot curves like the table windows. A properties dialog also pops-up allowing to customize all aspects of the
table. The table can be selected with a right mouse click on its border and moved or resized freely afterwards. A double-click on
a table cell enables in-place editing of its text. Plot tables also support copy/paste of text to/from clipboard.

3.5.9 Graph -> Add Color Scale

Adds a new color scale legend object to the active layer. You can have more than one color scale on a plot. These color scale
legends can later be customized by double clicking on a given legend.

3.5.10 Graph -> Add Equation... (Alt-Q)

This command is used to add a Tex formatted equation on a layer. When selected, the cursor changes to an edit text cursor. You
must then click in the plot area to specify the position of the new Tex equation. A Tex editor will pop-up allowing you to enter
the equation to be displayed and set its properties (color, frame, etc...)

3.5.11 Graph -> Add Text (Alt-T)

This command is used to add text items on a layer. When selected, the cursor changes to an edit text cursor. You must then click
in the plot area to specify the position of the new text box. A text dialog will pop-up allowing you to type the text to be displayed
and set all its properties (color, font, etc...)

3.5.12 Graph -> Draw Arrow (Ctrl-Alt-A)

Changes the active layer’s operational mode to drawing mode. You must click on the layer canvas in order to specify the starting
point for the new arrow, and then click once more to specify its ending point. You can edit the new arrow using the Arrow dialog.
Switch back to the normal operating mode by clicking the "Pointer" icon in the Plot toolbar.

3.5.13 Graph -> Draw Line (Ctrl-Alt-L)

Changes the active layer’s operational mode to drawing mode. You must click on the layer canvas in order to specify the starting
point for the new line, and then click once more to specify its ending point. You can edit the new line using the line dialog.
Switch back to normal operating mode by clicking the "Pointer" icon in the Plot toolbar.

3.5.14 Graph -> Add Rectangle (Ctrl-Alt-R)

Draws a rectangular box on the active plot layer. After selecting this command, the pointer changes to a crosshair target. Click
and hold the left mouse button on the active layer to indicate the first corner of the rectangle, then drag the cursor to the opposite
corner of the rectangle. Once the second point is specified, release the left mouse button to draw the rectangle. The pointer
automatically changes back to normal mode.

3.5.15 Graph -> Add Ellipse (Ctrl-Alt-E)

Draws a elliptical shape on the active plot layer. After selecting this command, the pointer changes to a crosshair target. Click
and hold the left mouse button on the active layer to indicate the first corner of the ellipse’s bounding rectangle, then drag the
cursor to the opposite corner of the bounding rectangle. Once the second point is specified, release the left mouse button to draw
the ellipse. The pointer automatically changes back to normal mode. Circles may be drawn using this command by setting the
height and width equal. (The object properties dialog can be used to set height and width to exactly the same value.)
The QtiPlot Handbook 43 / 452

3.5.16 Graph -> Add Time Stamp (Ctrl-Alt-T)

This command is used to add a special label in the active layer which contains the current date and time. The properties of this
label can be customized like any other label added by the Add Text.
The date and time copied into a timestamp label is not modified later if the plot is modified, saved, etc.

3.5.17 Graph -> Add Image (Alt-I)

Opens a file dialog allowing you to select an image to be added to the active plot layer. Only a link to the image file will be saved
into the project file and not the image itself. The new image is added to the left-top corner of the layer and can be moved with
the mouse using drag-and-drop.

3.5.18 Graph -> View Pixel Line Profile...

This command can be used to retrieve the pixel intensities from an image in the active 2D plot layer. It opens an integer value
dialog allowing to select the number of pixels to be averaged when calculating the pixel intensity. The selection of the pixel
range from the image is done manually by drawing a line whose end points must be situated inside the image. When the right
end point of the line is selected and the left button of the mouse is released, QtiPlot creates a new plot window displaying the
intensity profile curve.

Figure 3.1: The result of the View Pixel Line Profile... command.

3.5.19 Graph -> Add Central Axis

The commands in this menu can be used in order to add central axes, horizontal or vertical, to the active plot layer. The initial
position of an axis is in the center of the plot canvas, but it can be moved either by drag-and-drop with the mouse or using the
arrow keys. The axes can be fully customized via their Properties dialog which can be opened with a double-click on the axis
area. Central axes can be removed or hidden via their context menu. A right-click on the axis opens the context menu.

3.5.19.1 Add Horizontal Axis

Adds a central horizontal axis to the active plot layer. The axis can be moved by drag-and-drop with the mouse or using the Up
and Down arrow keys.
The QtiPlot Handbook 44 / 452

3.5.19.2 Add Vertical Axis

Adds a central vertical axis to the active plot layer. The axis can be moved by drag-and-drop with the mouse or using the Left
and Right arrow keys.

3.5.20 Graph -> Add Reference Line...

This command can be used in order to add horizontal or vertical straight lines to the active plot layer. It opens a dialog which
allows to customize the properties of the reference line.

3.5.21 Z-Order Commands...

The zorder commands act upon the last few items. Even though they do not appear in the graph menu, they are in the plot toolbar
and in the object drop down lists when right clicking a selected object.

3.5.21.1 Move to Top

Although this command does not appear in the Graph menu, it does act upon the objects created using the last few commands
(specifically legend, equation, text, timestamp, ellipse, rectangle and image objects). When a suitable object is selected, this
command will be available, either from the Plot toolbar or from the drop-down list that appears when right-clicking on a selected
object. When the command is used, the object will be made visible by being promoted to the front of the plot layer. It does not
affect the z-order relative to other objects. Their relative z-order depends only upon their order of creation.

3.5.21.2 Move to Bottom

Although this command does not appear in the Graph menu, it does act upon the objects created using the last few commands
(specifically legend, equation, text, timestamp, ellipse, rectangle and image objects). When a suitable object is selected, this
command will be available, either from the Plot toolbar or from the drop-down list that appears when right-clicking on a selected
object. When the command is used, the object will be made invisible by being demoted to the back of the plot layer. It does not
affect the z-order relative to other objects. Their relative z-order depends only upon their order of creation.

3.5.22 Graph -> Add Layer (Alt-L)

Adds a new layer to a graph window. The command opens a dialog which allows you to select whether the new layer is to be
added to the left-top corner of the plot window or to a best-guess position (based on a layer positioning algorithm in columns and
rows).

3.5.23 Graph -> Add Empty Inset Layer

This is a convenience command that creates a new, small sized, empty layer located on top of the currently selected layer. Once
this layer is created, you can further resize, move, set it’s properties and add curves to it as needed. Inset layers are not linked
to another layer in any way. They just happen to be located in the same place on the graph window. In fact the inset layer can
be moved anywhere on the graph window and is treated like a normal layer in every way. When the inset layer is completely
contained inside another layer, it will disappear under that layer when it is selected. The new inset layer has it’s own layer select
button in the upper left of the graph window. Clicking on this button will bring the inset back to the front, rendering it visible
again.

3.5.24 Graph -> Add Inset Layer With Curves

This command is essentially identical to the Add Empty Inset Layer command, with the single exception that any curves
contained in the currently active layer are duplicated in the new inset layer.
The QtiPlot Handbook 45 / 452

3.5.25 Graph -> Arrange Layers... (Shift-A)

Opens the Arrange layers dialog. This dialog allows you to customize the layout of the layers in the active graph window.

3.5.26 Graph -> Automatic Layout command

Automatically arranges all the layers in the active graph window. All layers are scaled to fit into the existing graph window.
Please be aware that the relative positions of the layers are not preserved during this operation.
Layers are packed into the smallest dimensioned array possible. Rows are added until a the smallest square array is filled, at
which point an additional column is added. Rows are then filled and additional rows added until the array is again square. For
example, 2 layers results in a 1x2 array. 3 layers produces a 2x2 array with an empty space in the second row. 4 layers produces
a full 2x2 array. Adding another layer will produce a 2x3 array, with one empty space in the second row. Additional layers result
in more rows and columns being added to contain all the layers.

3.5.27 Graph -> Fit Layers to Window

This command adjusts the dimensions of the existing layers to fit the current window size by shrinking them in both horizontal
and vertical direction. This operation should normally preserve the aspect ratio and the relative positions of the layers.

3.5.28 Graph -> Fit Window to Layers

This command adjusts the dimensions of the active 2D plot window in order to entirely display all its layers. The dimensions of
the layers as well as their relative positions are not changed during this operation.

3.5.29 Graph -> Extract to Layers command

Each curve in the currently active layer is moved onto a newly created layer. The original layer is destroyed. The newly created
layers are then auto arranged (see the Automatic Layout command).

3.5.30 Graph -> Extract to Graphs... command

Each layer in the currently active graph window is copied into its own, newly created, graph window, which has the same size
as the source graph window. This command also opens the Graph Manipulation dialog, allowing users to choose what happens
with the original graph window and if the new layers should be resized to fill the whole graph window.

3.5.31 Graph -> Merge Graph Windows... command

Opens the Graph Manipulation dialog in a mode that allows users to choose the graph windows to be merged in a new 2D plot
window.

3.5.32 Graph -> Remove Layer (Alt-R)

Deletes the active layer and pops-up a question dialog allowing you to choose whether the remaining layers should be automati-
cally re-arranged or not.

3.6 The Plot Menu

This menu is active only when a table is selected. These commands allow plotting data from the selected table. As a group, all
of these commands create a new graph window which contains a single, empty layer. The newly created plot is drawn on this
empty layer.
The QtiPlot Handbook 46 / 452

3.6.1 Plot Wizard (Ctrl-Alt-W)

Opens the Plot Wizard dialog.

3.6.2 Line ->

Selecting Line -> opens up a sub-menu of additional commands for plotting specialized graphs consisting of lines.

3.6.2.1 Line

Plots the selected data columns using "Line" style. The command can also be activated by clicking on the icon of the Table
toolbar. Once the plot is created, the drawing style of the data series can be customized with the Custom curves dialog.

3.6.2.2 Line Central

Plots a graph of the selected data columns using "Line" style and the X and Y axes located in the middle of the layer. The
command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of the
data series can be customized with the Custom curves dialog. The axes can also be customized by opening the corresponding
dialog via a double-click on the axis ticks or labels.

3.6.2.3 Vertical Steps

Plots the selected data columns using "Vertical Steps" style. Once the plot is created, the drawing style of the data series can be
customized with the Custom curves dialog.
The QtiPlot Handbook 47 / 452

3.6.2.4 Horizontal Steps

Plots the selected data columns using "Horizontal Steps" style. Once the plot is created, the drawing style of the data series can
be customized with the Custom curves dialog.

3.6.3 Symbol ->

Selecting Symbol -> opens up a sub-menu of additional commands for plotting specialized graphs using "Scatter" style for the
data.

3.6.3.1 Scatter

Similar to the Line command except that the plot is drawn using "Scatter" style. The command can also be activated by clicking
on the icon of the Table toolbar. Once the plot is created, the drawing style of the data series can be customized with the Plot
details dialog.
The QtiPlot Handbook 48 / 452

3.6.3.2 Scatter Central

Plots a graph of the selected data columns using "Scatter" style and the X and Y axes located in the middle of the layer. The
command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of the
data series can be customized with the Plot details dialog. The axes can also be customized by opening the corresponding dialog
via a double-click on the axis ticks or labels.

3.6.3.3 Vertical Drop Lines

Plots the selected data columns using "Vertical drop lines" style. The command can also be activated by clicking on the icon
of the Table toolbar. Once the plot is created, the drawing style of the data series can be customized with the Plot details dialog.
The QtiPlot Handbook 49 / 452

3.6.3.4 Bubble

Plots the selected data columns using indexed sizes for the plot symbols. You need to select at least two Y columns for this plot
operation. The first Y column in the selection is used for the positions of the plot symbols and the next one determines their
sizes. The command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing
style of the data series can be customized with the Plot details dialog.

3.6.3.5 Color Mapped

Plots the selected data columns using a default color map for the plot symbols. You need to select at least two Y columns for
this plot operation. The first Y column in the selection is used for the positions of the plot symbols and the next one determines
their color. QtiPlot finds the minimum and maximum values in the second Y column, creates eight evenly sized ranges of values
between the minimum and maximum values, and then associates a color with each range of values. Each data point color is
determined by finding the color associated with the second Y column value in the color map.
The command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of
the data series can be customized with the Plot details dialog.
The QtiPlot Handbook 50 / 452

3.6.3.6 Bubble + Color Mapped

Plots the selected data columns using indexed sizes and a default color map for the plot symbols. You need to select at least
two Y columns for this plot operation. The first Y column in the selection is used for the positions of the plot symbols and the
next one determines their sizes. If the selection contains three Y columns the third column controls the symbol color: QtiPlot
finds the minimum and maximum values in this Y column, creates eight evenly sized ranges of values between the minimum and
maximum values, and then associates a color with each range of values. Each data point color is determined by finding the color
associated with the second Y column value in the color map. If the column selection contains only two Y columns the second
column controls both the size and color of the symbols.
The command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of
the data series can be customized with the Plot details dialog.

3.6.4 Line + Symbol ->

3.6.4.1 Line+Symbol

Identical to the Line command except that the plot is drawn using "Line + Symbol" style. This command can also be activated
by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of the data series can be customized
with the Custom curves dialog.
The QtiPlot Handbook 51 / 452

3.6.4.2 Line + Symbol Central

Plots a graph of the selected data columns using "Line + Symbol" style and the X and Y axes located in the middle of the layer.
The command can also be activated by clicking on the icon of the Table toolbar. Once the plot is created, the drawing style of
the data series can be customized with the Custom curves dialog. The axes can also be customized by opening the corresponding
dialog via a double-click on the axis ticks or labels.

3.6.4.3 Spline

Plots the selected data columns using "Spline" style. Once the plot is created, the drawing style of the data series can be
customized with the Custom curves dialog.

3.6.5 Column/Bar/Pie ->

Selecting Column/Bar/Pie opens up a sub-menu of commands for plotting specialized bar and column graphs.

3.6.5.1 Columns

Plots the selected data columns using "Columns" style, that is vertical bars. By default the baseline for the columns is the Y = 0
axis. It is possible to define a different baseline value via the plot details dialog.
The QtiPlot Handbook 52 / 452

3.6.5.2 Rows

Plots the selected data columns using "Rows" style. By default the baseline for the rows is the X = 0 axis. It is possible to define
a different baseline value via the plot details dialog.

3.6.5.3 Stack Column

This command can be activated by clicking on the icon of the Table toolbar. The Stack Column command plots a stack-
column for each selected row in the currently active table. It is essentially the same as the Stack Bar plot, but drawn as vertical
stack-columns rather than horizontal stack-bars.

3.6.5.4 Stack Bar

This command can be activated by clicking on the icon of the Table toolbar. The Stack Bar command plots a stack-bar for
each selected row in the currently active table. They may be used to conveniently display cumulative data that changes over
time, such as budgetary information. The stack-bars are drawn one above the other in a position determined by the X value of the
corresponding row. Each stack-bar is composed of a set of joined segments. The widths of the segments are set by the Y values in
the row and their relative positions correspond to the column order in the table. Each segment is plotted in a color corresponding
to the column number of the Y value determining the segment’s width. Colors, segment outlining, vertical separation of the
stack-bars, and the axis values can all be customized. An example of a stack-bar plot is shown below, followed by the table that
was used to generate the plot.
The QtiPlot Handbook 53 / 452

A stack-bar plot showing a hypothetical budgetary breakdown for a 5 year period. The data in the table shown below was used
to generate this plot.

3.6.5.5 100% Stack Column

This command can be activated by clicking on the icon of the Table toolbar. The 100% Stack Column command plots a
stack-column for each selected row in the currently active table. It is essentially the same as the 100% Stack Bar plot, but drawn
as vertical stack-columns rather than horizontal stack-bars.

3.6.5.6 100% Stack Bar

This command can be activated by clicking on the icon of the Table toolbar. The 100% Stack Bar command plots a stack-
bar for each selected row in the currently active table, comparing the percentage that each value contributes to a total across
categories. You can use a 100% stacked bar plot when you have several data sets and you want to emphasize the contributions to
the whole, especially if the total is the same for each category.

3.6.5.7 Floating Column

This command can be activated by clicking on the icon of the Table toolbar. The floating column graph displays Y values as
beginning and ending column levels for each X value. You must select at least two Y columns of values (or a range from at least
The QtiPlot Handbook 54 / 452

two columns). If there is an X column to the left of the Y columns, the X column values are used; otherwise, the worksheet’s
default X values are used.

3.6.5.8 Floating Bar

This command can be activated by clicking on the icon of the Table toolbar. The floating bar graph displays Y values as
beginning and ending bar levels for each X value. The X values are plotted along the vertical axis. You must select at least two
Y columns of values (or a range from at least two columns). If there is an X column to the left of the Y columns, the X column
values are used; otherwise, the worksheet’s default X values are used.

3.6.5.9 3D Color Pie Chart

This command can be activated by clicking on the icon of the Table toolbar. Creates a pseudo 3D colored pie chart using the
selected column in the active table window (only one column allowed).

3.6.5.10 2D Color Pie Chart

This command can be activated by clicking on the icon of the Table toolbar. Creates a 2D colored pie chart using the selected
column in the active table window (only one column allowed).
The QtiPlot Handbook 55 / 452

3.6.5.11 Doughnut

This command can be activated by clicking on the icon of the Table toolbar. Creates a 2D colored doughnut chart using the
selected columns in the active table window.

3.6.6 Multi-Curve ->

Selecting Multi-Curve -> opens up a sub-menu of additional commands for plotting multiple data sets.

3.6.6.1 Double-Y

Creates a double Y axis graph. Requires a selection of at least two Y columns (or a range from at least two columns). The last Y
column in the selection range is attached to the right axis of the plot layer.

3.6.6.2 3Y: Y-YY

Creates a three Y axes graph. Requires a selection of at least three Y columns (or a range from at least three columns). In order
to display a third Y axis QtiPlot uses two plot layers with overlapping drawing canvases. The right axis of the second plot layer
is displayed using a horizontal offset with respect to the drawing canvas. The last data curve created from the selected range is
attached to this axis.
The QtiPlot Handbook 56 / 452

3.6.6.3 4Y: YY-YY

Creates a four Y axes graph. Requires a selection of at least four Y columns (or a range from at least four columns). Two
overlapping layers are created for this type of plot. Both Y axes of the second plot layer are enabled.

3.6.6.4 Stack Lines by Y Offsets

Creates a new graph window containing a Stacked Lines plot generated from data in the selected columns. Each column is drawn
as a separate curve which has a vertical offset from the previous one. This offset setting that can be modified in the Stack tab of
the Plot Details dialog. By default, Stacked Lines by Y Offsets graphs employ the "Auto" data plot offset type, meaning that a
gap of 8% is automatically calculated between each data plot. The distances between each curve can be adjusted using this offset
feature to eliminate the need to change the original data. Using this feature prevents the curves from overlapping and ensures
that each curve can be viewed clearly.
The QtiPlot Handbook 57 / 452

3.6.6.5 Waterfall

Creates a new graph window containing a waterfall plot generated from data in the selected columns. Each column is drawn as
a separate curve which is offset from the previous one in both X and Y, creating the so-called waterfall effect. The figure shown
below is a simple example of a waterfall plot where each column is simply an attenuated version of the previous column.

3.6.6.6 Colormapped Lines

Requires a selection of at least two Y columns (or a data range from at least two columns). Creates a new graph window
displaying each data set as a line curve. Existing column comments are treated as Z values if they are valid floating point values.
If there are no valid column comments, the column indices define the Z values. The colors of the curves are mapped to these Z
values and a color scale legend is added at the right side of the plot layer.

3.6.7 Area ->

Selecting Area -> opens up a sub-menu of additional commands for generating area graphs.

3.6.7.1 Area

An Area graph is a line graph with the areas below the lines filled with colors. This command can be activated by clicking on
the icon of the Table toolbar. You must select at least one Y column of values (or a range from at least one column). If the
Y column(s) has an associated X column, the X column supplies the X values; otherwise, the worksheet’s default X values are
used.
By default the baseline for the area is the Y = 0 axis. It is possible to define a different baseline value via the plot details dialog.
The QtiPlot Handbook 58 / 452

3.6.7.2 Stack Area

This command can be activated by clicking on the icon of the Table toolbar. In order to create this type of graph you must
select at least two Y columns of values (or a range from at least two columns). Each successive column of values is displayed as
an area graph that is stacked on the previous area graph. The upper bounds of the first area graph is treated as the baseline of the
next area graph.

3.6.7.3 100% Stack Area

This command can be activated by clicking on the icon of the Table toolbar. In order to create this type of graph you must
select at least two Y columns of values (or a range from at least two columns). 100% Stack Area graphs help comparing the
percentage that each value contributes to a total across categories. You can use them when you have several data sets and you
want to emphasize the contributions to the whole, especially if the total is the same for each category.

3.6.7.4 Fill Area

This command can be activated by clicking on the icon of the Table toolbar. In order to create this type of graph you must
select at least two Y columns of values (or a range from at least two columns). If there is an X column to the left of the Y
columns, the X column values are used; otherwise, the worksheet’s default X values are used. The area between the data plots
(the two Y columns) is filled using a default blue fill pattern.

3.6.8 Special Line/Symbol ->

3.6.8.1 Vectors XYXY

Creates a vectors plot using the selected columns in the active table window. You must select four columns for this particular type
of plot. The first two columns give the coordinates of the starting points of the vectors, the last two columns give the coordinates
of the end points.
The QtiPlot Handbook 59 / 452

3.6.8.2 Vectors XYAM

Creates a vectors plot using the selected columns in the active table window. You must select four columns for this particular
type of plot. The first two columns give the coordinates of the starting points of the vectors, the last two columns give the angles
(in radians) and magnitudes of the vectors. It is also possible to define constant angle and magnitude values like in the example
bellow showing an uniform vector field.

3.6.8.3 Zoom

Creates a new graph with 2 layers. The first is a standard plot layer which contains a curve for each selected Y column. The
second is a special layer which has 2 components: 1) There is a standard plot layer that shows a portion of the first layer’s surface
in a magnified view; 2) There is a separate graphical window that can be sized and dragged around the first layer to specify the
portion of that layer which is shown in the magnified view. The figure below shows a typical zoom plot.
The QtiPlot Handbook 60 / 452

3.6.9 Statistical Graphs ->

Selecting the Statistical Graphs -> item opens up a sub-menu of commands for plotting various statistical graphs. Statistical
plots do not give a direct drawing of the selected table data. However, a representation of the frequency distribution of the
Y-values is plotted.

3.6.9.1 Box Plot

Creates a box plot using the selected data columns in the active table window. This type of plot is used to give a graphical
representation of some of the classical parameters of a frequency distribution, such as the mean, the min and max values, the
position of the 95 and 5 percentiles, etc. The choice of the statistical parameters and the graphical parameters can be modified
with the Custom curves dialog.

3.6.9.2 Box Plot + Data

Creates a box and data overlapped plot using the selected data columns in the active table window. This type of plot is used to
give a graphical representation of some of the classical parameters of a frequency distribution, such as the mean, the min and
max values, the position of the 95 and 5 percentiles, etc. The choice of the statistical parameters and the graphical parameters
can be modified with the Custom curves dialog.
The QtiPlot Handbook 61 / 452

3.6.9.3 Interval Plot

Creates an interval plot using the selected data columns in the active table window. The interval plot is a box chart whose box
type is set to Box, the box style is set to No Box and only displays the percentile symbol for the mean, drawn using a solid ellipse
style. The range of the whiskers is set by default to Confidence Interval with a probability of 95% around the mean.

3.6.9.4 Scatter Interval

Creates a scatter interval plot using the selected data columns in the active table window. The scatter interval plot is a box chart
whose box type is set to Box + Data, the box style is set to No Box. The range of the whiskers is set by default to SE (Standard
Error) with a coefficient of 1.0 and the display of the mean line is enabled.

3.6.9.5 Violin Plot

Creates a violin plot using the selected data columns in the active table window. The violin plot is a special type of box chart,
whose type is set to Box, the box style is set to No Box, the range of the whiskers is set to None and has a symmetric Kernel
Smooth distribution curve overlayed on the binned data. The symmetric distribution curve has a semi transparent color filling.
The QtiPlot Handbook 62 / 452

3.6.9.6 Violin with Box

Creates a violin with box plot using the selected data columns in the active table window. The violin with box plot is a box chart
whose box type is set to Box, the box style is set to Rectangle, the range of the whiskers is set to MinMax and has a symmetric
Kernel Smooth distribution curve overlayed on the binned data. The symmetric distribution curve has a semi transparent color
filling.

3.6.9.7 Ridgeline

Ridgeline curves are a special type of half violin plots, with exchanged X and Y axes. They can be quite useful when visualizing
the distribution of several numeric variables. The partially overlapping distribution curves create the impression of a mountain
range, which explains the name of this type of statistical plot. Their aspect and other properties can be customized using the Plot
details... dialog.

3.6.9.8 Histogram

Creates a frequency histogram of the selected data columns in the active table window. The default binning uses 10 steps between
the maximum and the minimum values. In order to customize the histogram double-click on the curve or right-click and select
"Properties...". Both actions open the Plot Details dialog. The histogram controls are available on tabs on the right side of
the dialog box. Binning behavior as well as the display of a distribution curve on the binned data can be customized via the
Histogram Data tab.
The QtiPlot Handbook 63 / 452

Note that this command plots a frequency distribution that is computed from your data. If you want to draw a histogram directly
from data values, use the Bars plot instead.

3.6.9.9 Histogram + Probabilities

This command can be activated by clicking on the icon of the Table toolbar. You must select exactly one Y column or a range
from a table column. The Histogram + Probabilities creates a frequency histogram of the selected data column in the active
table window, exactly like the Histogram command. Additionally, it plots a cumulative sum of observations in a second graph
layer (layer 2). The statistical results - the mean, the standard deviation, the maximum and minimum values, and the total number
of values - are also displayed to the Results log.
The two layers in the Histogram + Probabilities graph are linked. Therefore, before you make changes to the X axis scale or to
the dimensions of the layer, make sure that the layer 2 is the active layer. This will ensure that the axis scales and dimensions of
the layer 1 are adjusted accordingly.

3.6.9.10 Histogram + Probabilities (Double-Y)

This command can be activated by clicking on the icon of the Table toolbar. You must select exactly one Y column or a range
from a table column. The Histogram + Probabilities (Double-Y) creates a frequency histogram of the selected data column in
the active table window, exactly like the Histogram command. Additionally, it plots a cumulative sum of observations using a
vertical steps style. The cumulative percent curve is linked to the right Y axis of the graph layer, while the histogram is linked to
the left Y axis.

The statistical results - the mean, the standard deviation, the maximum and minimum values, and the total number of values - are
also displayed to the Results log.

3.6.9.11 Stacked Histogram

Creates vertically stacked layers displaying the histograms of the selected data columns in the active table window (one histogram
per layer) See the Vertical 2 Layers command for more details.
The QtiPlot Handbook 64 / 452

3.6.9.12 Pareto Chart - Binned Data

This command can be activated by clicking on the icon of the Table toolbar. It creates a Pareto chart of the selected data
column in the active table window. The input data typically consists of a text column containing the categories/items and one of
numbers containing the corresponding counts or bins. You must select one or two columns.

3.6.9.13 Pareto Chart - Raw Data

This command can be activated by clicking on the icon of the Table toolbar. It creates a Pareto chart of the selected data
column in the active table window. The input data typically consists of a text column containing the categories/items. QtiPlot
counts the number of times each category/item occurs in the input data column and orders the results in decreasing order. You
must select exactly one column.

3.6.9.14 Bland-Altman Plot...

This command can be activated by clicking on the icon of the Table toolbar. It opens the Bland-Altman Plot dialog that allows
to create and customize a Bland-Altman plot of the selected data columns in the active table window. You must select at least
two columns.
The QtiPlot Handbook 65 / 452

3.6.9.15 Q-Q Plot...

This command can be activated by clicking on the icon of the Table toolbar. It opens the Q-Q Plot dialog that allows to create
and customize a Q-Q plot of the selected data column in the active table window. You must select a single column.

3.6.9.16 Stem and Leaf

Generates a stem-and-leaf tabular plot from the selected column in a new note window. Stem-and-Leaf plots are similar to
histograms but are represented using rows of decimal digits. Like a histogram, data is binned, usually by taking the most
significant digits (MSDs) as "stem" values which are listed in a column on the left. The least significant digit(s) from all values
having identical MSDs are then listed to the right of each stem value. From a statistical point of view, this gives the appearance
of a histogram but preserves the actual data values in the plot. When this command is executed, you will be given the opportunity
to select/confirm the binning increment, which is given as a power of 10 and defaults to a power of 1 (that is, a binning increment
of 10).
The QtiPlot Handbook 66 / 452

This figure shows a typical stem-and-leaf representation of 48 random data points which are roughly Gaussian (i.e., normally
distributed) and uses the default binning increment of 10.

3.6.10 Panel ->

Selecting the Plot -> Panel -> menu item opens a sub-menu of commands that can be used to quickly obtain some commonly
used arrangements of multiple plots. Unlike other commands in this menu, the new graph window that is created may have more
than one layer (as needed).

3.6.10.1 Vertical 2 Layers

Creates 2 vertically stacked layers. The data columns selected in the active table window (one curve per layer) are plotted on
these layers.

3.6.10.2 Horizontal 2 Layers

Creates 2 horizontally stacked layers. The data columns selected in the active table window (one curve per layer) are plotted on
these layers.

3.6.10.3 4 Layers

Creates 4 layers on a 2x2 grid. The data columns selected in the active table window (one curve per layer) are plotted on these
layers.

3.6.10.4 Stacked Layers

Creates a group of vertically stacked layers, one layer per Y-Coordinate column selected. Data columns selected in the active
table window (one curve per layer) are plotted on these layers.

3.6.10.5 Custom Layout...

Opens the Arrange Layers dialog which allows complete customization of the layer layout.
The QtiPlot Handbook 67 / 452

3.6.11 3D XYY ->

Selecting the Plot -> 3D XYY -> menu item opens a sub-menu of commands used to draw some common 3D plots of XYY data
columns from table windows. If the column selection do not include a X type column, the values for the X axis are automatically
calculated by QtiPlot using row indices.

3.6.11.1 Bars

Makes a 3D plot of the selected data columns in the active table window using Bars style.

3.6.11.2 Inline Bars

Makes a 3D plot of the selected data columns in the active table window using Inline Bars style.
The QtiPlot Handbook 68 / 452

3.6.11.3 Stack Bars

Makes a 3D plot of the selected data columns in the active table window using Stack Bars style.

3.6.11.4 100% Stack Bars

Makes a 3D plot of the selected data columns in the active table window using 100% Stack Bars style.

3.6.11.5 Ribbons

Makes a 3D plot of the selected data columns in the active table window using Ribbon style.
The QtiPlot Handbook 69 / 452

3.6.11.6 Wall

Makes a 3D plot of the selected data columns in the active table window using Wall style.

3.6.11.7 Stacked Wall

Makes a 3D plot of the selected data columns in the active table window using Stack Wall style.
The QtiPlot Handbook 70 / 452

3.6.11.8 100% Stacked Wall

Makes a 3D plot of the selected data columns in the active table window using 100% Stack Wall style.

3.6.11.9 Waterfall Plot

Makes a 3D plot of the selected data columns in the active table window using Waterfall style. The line color of each curve is
determined by its index in the default Indexed colors list that can be customized via the Curves tab of the 2D Plots preferences
dialog.
The default color used to fill the area bellow each curve, as well as the drawing of the side lines and of a base line can be
customized using the controls in the Fill area under curve group box from the Curves tab of the 3D Plots preferences dialog.
The QtiPlot Handbook 71 / 452

3.6.11.10 Waterfall Plot (Color Mapped)

Makes a 3D plot of the selected data columns in the active table window using Waterfall style. The line color of each curve is
given by the default color map that can be customized via the Colors tab of the 3D Plots preferences dialog.

The default color used to fill the area bellow each curve, as well as the drawing of the side lines and of a base line can be
customized using the controls in the Fill area under curve group box from the Curves tab of the 3D Plots preferences dialog.

3.6.11.11 Area

Makes a 3D plot of the selected data columns in the active table window using Area style. The default color used to fill the area
bellow each curve is determined by the index of the curve in the default Indexed colors list that can be customized via the Curves
tab of the 2D Plots preferences dialog.
The QtiPlot Handbook 72 / 452

3.6.11.12 Stack Area

Makes a 3D plot of the selected data columns in the active table window using Stack Area style.

3.6.11.13 100% Stack Area

Makes a 3D plot of the selected data columns in the active table window using 100% Stack Area style.
The QtiPlot Handbook 73 / 452

3.6.11.14 Trajectory

Makes a 3D plot of the selected data columns in the active table window using Trajectory style. The line color of each curve is
determined by its index in the default Indexed colors list that can be customized via the Curves tab of the 2D Plots preferences
dialog.

The default line style and line width of the curves can be customized using the controls in the Mesh group box from the Curves
tab of the 3D Plots preferences dialog.

3.6.11.15 Scatter

Makes a 3D plot of the selected data columns in the active table window using Scatter style.
The QtiPlot Handbook 74 / 452

3.6.11.16 Trajectory + Dots

Makes a 3D plot of the selected data columns in the active table window using LineSymbols style. The line color of each curve
is determined by its index in the default Indexed colors list that can be customized via the Curves tab of the 2D Plots preferences
dialog.

The default line style and line width of the curves can be customized using the controls in the Mesh group box from the Curves
tab of the 3D Plots preferences dialog.

3.6.12 3D Plot ->

Selecting the Plot -> 3D Plot -> menu item opens a sub-menu of commands used to draw some common 3D plots of 2D data.

3.6.12.1 Ribbons

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using Ribbon style.
The QtiPlot Handbook 75 / 452

3.6.12.2 Bars

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using "3D Bars" style.

3.6.12.3 Scatter

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using "3D Dots" style. The
3D point symbol style can be changed via the 3D Plots Settings dialog.

With scatter plots, you can choose the kind of graphic item which is used to plot the data points. The example above is done with
dots, but you can also select cross hairs or cones. This can be done either with the corresponding icons of the 3D plot toolbar
(respectively and for cross-hairs, dots and cones) or with the Data tab of the 3D plot options dialog.
The QtiPlot Handbook 76 / 452

3.6.12.4 Trajectory

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using "3D Line" style. The
line width and color may be changed via the 3D Plot Settings dialog.

3.6.12.5 Trajectory + Dots

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using a line and dot symbols
style. The default properties of the line (width and color) and of the symbols (style, size, etc...) may be changed via the 3D Plots
Settings dialog.

3.6.12.6 Vectors XYZ XYZ

Makes a 3D vectors plot of the selected data columns in the active table window (six columns needed). The XYZ XYZ data in
the six columns define the start and end points for the vectors. The line width, color and other properties of the vectors may be
changed via the 3D Vectors tab of the 3D Plot Settings dialog.

3.6.12.7 Vectors XYZ dXdYdZ

Makes a 3D vectors plot of the selected data columns in the active table window (six columns needed). The XYZ dXdYdZ data
columns provide the vector start points and the distances between the projections of the start and end points of the vectors on the
three axes, X, Y and Z, respectively. The line width, color and other properties of the vectors may be changed via the 3D Vectors
tab of the 3D Plot Settings dialog.
The QtiPlot Handbook 77 / 452

3.7 The 3D Plot menu

This menu is only active (visible) when a matrix is selected.

3.7.1 3D Wire Frame

Makes a 3D plot of the selected matrix using the "3D mesh" style.

3.7.2 3D Hidden Lines

Makes a 3D plot of the matrix using the "3D mesh" style with hidden lines.
The QtiPlot Handbook 78 / 452

3.7.3 3D Polygons

Makes a 3D plot of the matrix using the "3D polygons" style.

3.7.4 3D Wire Surface

Makes a 3D plot of the matrix using the "3D polygons" style with the mesh drawn.

3.7.5 Bars

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using the "3D Bars" style.
The QtiPlot Handbook 79 / 452

3.7.6 Scatter

Makes a 3D plot of the selected data column in the active table window (only one column allowed) using the "3D Dots" style.
The 3D point symbol style can be changed via the 3D Plots Settings dialog.

3.7.7 Contour+Color Fill

Makes a color map plot of the data in the active matrix window. The contour lines and the colormap settings may be changed by
clicking on the plotting area. This will activate the Contour Options Dialog.
The QtiPlot Handbook 80 / 452

3.7.8 Countour Lines

Makes a contour plot of the data in the active matrix window. The contour lines and the colormap settings may be changed by
clicking on the plotting area. This will activate the Contour Options Dialog.

3.7.9 Countour Lines - Color Mapped

Makes a contour lines plot of the data in the active matrix window, the colors of the contour lines being mapped to the Z scale.
The contour lines and the colormap settings may be changed by clicking on the plotting area. This will activate the Contour
Options Dialog.
The QtiPlot Handbook 81 / 452

3.7.10 Gray Scale Map

Makes a gray map plot of the data in the active matrix window. The contour lines and the colormap settings may be changed by
clicking on the plotting area. This will activate the Contour Options Dialog.

3.7.11 Heat Map

Makes a heat map plot of the data in the active matrix window. This type of graph is similar to the contour plot with the following
differences: the contour lines are not drawn, there are no minor ticks and a three color based map (blue, white, red) is used
instead of the default Rainbow palette. The color map settings can be changed by double-clicking on the plotting area. This will
activate the Colors tab of the Contour Options Dialog.
The QtiPlot Handbook 82 / 452

3.8 The Data Menu

This menu is visible and active only when a graph window is selected. Commands in this menu will act on the plot/layer that is
currently active in the graph window. All of these commands are switches - that is, they switch on an operational mode which
remains in effect until it is canceled by selecting another command or by using the Disable tools command.

3.8.1 Data -> Disable tools

For many of the remaining commands in this menu, QtiPlot will be locked into a special mode corresponding to that command,
and that command’s special pointer will be used instead of the normal pointer. This command is used to exit any of these special
modes, returning QtiPlot to its normal mode and pointer behavior.

3.8.2 Data -> Zoom In/Out and Drag Canvas

Switches the active plot layer into a dynamic zoom/drag mode. Upon command execution, the default mode is "dynamic drag".
To drag the plot, simply left click anywhere in the plotting area and drag the plot around with the mouse. Drop it at the new
location by releasing the left mouse button. To zoom the plot, switch to dynamic zoom mode by first right clicking somewhere
in the plot area. (This will probably pop-up a context menu that you should ignore.) Next, left click at a suitable zoom reference
point in the plot area to enter dynamic zoom mode (this will also dismiss any pop-up menu). Once in dynamic zoom mode, scale
the plot by moving the mouse cursor up to zoom out, or down to zoom in. Right and left mouse movements have no effect. You
should use some foresight in picking the zoom reference point. For example, selecting a point at the bottom of the plot area will
limit zooming to upward mouse travel - that is, you will only be able to zoom out. Once a suitable zoom factor has been found,
left click anywhere in the plot to accept the zoom and return to dynamic drag mode.
Note that the mouse wheel is always active when using this command. It can be used to zoom while in either dynamic drag or
dynamic zoom modes. Also note that in either mode, zooming leaves the plot’s aspect ratio unchanged.

3.8.3 Data -> Zoom/Drag Canvas Horizontally

Switches the active plot layer into a dynamic zoom/drag mode which is limited to the horizontal direction. Upon command
execution, the default mode is "dynamic horizontal drag". To drag the plot, simply left click anywhere in the plotting area and
drag the plot to the right or left with the mouse. Drop it at the new location by releasing the left mouse button. Note that it may
appear that you can move the plot up or down while dragging, but the original vertical location will be restored when the plot
is dropped at the new horizontal location. To zoom the plot, switch to dynamic horizontal zoom mode by first right clicking
The QtiPlot Handbook 83 / 452

somewhere in the plot area. (This will probably pop-up a context menu that you should ignore.) Next, left click at a suitable
zoom reference point in the plot area to enter dynamic horizontal zoom mode (this will also dismiss any pop-up menu). Once in
dynamic horizontal zoom mode, scale the plot’s width by moving the mouse cursor up to zoom out, or down to zoom in. Right
and left mouse movements have no effect. You should use some foresight in picking the zoom reference point. For example,
selecting a point at the bottom of the plot area will limit zooming to upward mouse travel - that is, you will only be able to
zoom out. Once a suitable zoom factor has been found, left click anywhere in the plot to accept the zoom and return to dynamic
horizontal drag mode.
Note that the mouse wheel is always active when using this command. It can be used to zoom while in either dynamic horizontal
drag or dynamic horizontal zoom modes. Also note that in either horizontal mode, zooming will change the plot’s aspect ratio.

3.8.4 Data -> Zoom/Drag Canvas Vertically

Switches the active plot layer into a dynamic zoom/drag mode which is limited to the vertical direction. Upon command execu-
tion, the default mode is "dynamic vertical drag". To drag the plot, simply left click anywhere in the plotting area and drag the
plot up or down with the mouse. Drop it at the new location by releasing the left mouse button. Note that it may appear that you
can move the plot right or left while dragging, but the original horizontal location will be restored when the plot is dropped at
the new vertical location. To zoom the plot, switch to dynamic vertical zoom mode by first right clicking somewhere in the plot
area. (This will probably pop-up a context menu that you should ignore.) Next, left click at a suitable zoom reference point in the
plot area to enter dynamic vertical zoom mode (this will also dismiss any pop-up menu). Once in dynamic vertical zoom mode,
scale the plot’s height by moving the mouse cursor up to zoom out, or down to zoom in. Right and left mouse movements have
no effect. You should use some foresight in picking the zoom reference point. For example, selecting a point at the bottom of the
plot area will limit zooming to upward mouse travel - that is, you will only be able to zoom out. Once a suitable zoom factor has
been found, left click anywhere in the plot to accept the zoom and return to dynamic vertical drag mode.
Note that the mouse wheel is always active when using this command. It can be used to zoom while in either dynamic vertical
drag or dynamic vertical zoom modes. Also note that in either vertical mode, zooming will change the plot’s aspect ratio.

3.8.5 Data -> Zoom in (Ctrl-+)

Switches the active plot layer to zoom mode. The mouse cursor shape changes to a magnifying lens when it is inside a plot
canvas. To zoom the plot, draw a box around a selected part of the plot by clicking at one corner of the desired box, dragging the
mouse pointer to the opposite corner of the box and clicking a second time. The plot will be zoomed up such that the contents of
the drawn box now fills the existing plotting area.

3.8.6 Data -> Zoom out (Ctrl--)

This command cancels a previous zoom operation. A zoom history is kept so that you can do multiple zoom out commands to
step backwards through the zoom history. A separate zoom history is maintained for each plot layer. Executing this command
does not set any special mode of its own but it will cancel any other special mode that is currently in effect (i.e., it performs an
implicit Disable tools command).

3.8.7 Data -> Select Data Range (Alt-S)

Shows two vertical line cursors that are used for selecting a data range when performing analysis operations. Only one cursor
is active at a time. The active cursor is red, the other is black. You change which cursor is active with the Left and Right arrow
keys. Move the active cursor with the arrows keys while keeping the Ctrl key pressed or, more easily and quickly, by clicking
on a curve point. Note that the mouse cursor shape changes to a rectangular target while inside the active plot canvas. Navigate
through the curves on the plot layer using the Up and Down arrow keys. When this tool is active you can easily copy, paste or
cut the whole selected data range using the well-known shortcuts: Ctrl+C, Ctrl+V and Ctrl+X, respectively.
The QtiPlot Handbook 84 / 452

3.8.8 Data -> Data Reader (Ctrl-D)

Shows a red cross cursor and opens the Data Display toolbar giving easy and quick access to the values of the data points. Select
data points by moving the cursor with the Left and Right arrow keys or, more easily and quickly, by clicking on them with the
mouse. Navigate through the curves on the plot layer with the Up and Down arrow keys. The [Home] key makes the data reader
jump to the beginning of the selected curve and the [End] key to its end point.

3.8.9 Data -> Annotation

Opens the Data Display toolbar and changes the mouse cursor shape to a small cross target. The coordinates of the cursor with
respect to the axes of the active plot layer are displayed in a text field that floats along with the mouse cursor. Clicking the left
mouse button at any data point of a plot curve will draw a red crosshair at that point and copy the x and y coordinates of that
point into the data display. A double-click or pressing the [Enter] key adds an annotation to the plot. Pressing the [TAB] key
toggles the annotation form. Available label forms are:

1. x: Use the X coordinates of the data point as label.


2. y: Use the Y coordinates of the data point as label.
3. i: Use the table row index of the data point as label.
4. (x,y): Use the X and Y coordinates of the data point as label.
5. (x,y)[i]: Use the X and Y coordinates and the table row index of the data point as label.

3.8.10 Data -> Screen Reader

Opens the Data Display toolbar and changes the mouse cursor shape to a small cross target. The coordinates of the cursor with
respect to the axes of the active plot layer are displayed in a text field that floats along with the mouse cursor. Clicking the left
mouse button at any point will draw a red crosshair at that point and copy the x and y coordinates of that point into the data
display.

3.8.11 Data -> Vertical Cursor...

Shows a vertical red cursor and opens the Vertical Cursor dialog which gives quick access to the values of the data points for all
curves in a plot layer. Select data points by moving the cursor with the Left and Right arrow keys or, more easily and quickly, by
clicking on them with the mouse.

3.8.12 Data -> Draw Data Points

This command is very similar to the Screen Reader command but with the addition of the ability to add data points to a plot by
double clicking at each of the desired points. Each invocation of this command will create a new table titled "DrawN", where
N is an integer number that is incremented after each new table addition. These tables can be renamed and reformatted after
creation using the standard window manipulation commands.

3.8.13 Data -> Move Data points (Ctrl-Alt-M)

Allows modification of the position of data points on the active plot layer by simple drag-and-drop. Precise positioning of the
data points can be done using the numeric keypad which define a sort of compass rose:

1. 8-key: North
2. 9-key: North-East
3. 6-key: East
The QtiPlot Handbook 85 / 452

4. 3-key: South-East
5. 2-key: South
6. 1-key: South-West

7. 4-key: West
8. 7-key: North-West

When selecting this command, you will be asked to confirm that you understand that any changes you make will automatically
modify the data in the corresponding tables (as well as all plots depending on that data). The coordinates of the cursor with
respect to the axes of the plot layer are displayed in a text field that floats along with the mouse cursor. However, the Data
Display toolbar is also opened to provide a higher resolution display the new coordinates.

3.8.14 Data -> Remove Bad Data Points (Alt-B)

Allows removal of data points from the active plot layer by double-clicking on them. When selecting this command, you will be
asked to confirm that you understand that any changes you make will also modify the data in the corresponding tables (as well
as all plots depending on that data). The coordinates of the cursor with respect to the axes of the plot layer are displayed in a text
field that floats along with the mouse cursor. The coordinates of all points selected for removal are shown in the Data Display
toolbar.

3.8.15 Data -> Remove Bad Data Points

Allows dragging an entire curve on the selected plot layer. Left Click and hold down the mouse button on any point on a curve to
select the curve for dragging. A red cross-hair will be drawn at the point to indicate that the curve is selected. The curve may then
be dragged around on the plot layer with the mouse as long as the left mouse button is held down. Releasing the mouse button
will drop the curve at the new location. This process moves all the data points and changes the coordinates in the associated
table. When selecting this command, you will be asked to confirm that you understand that dragging curves will modify the data
in the corresponding tables (as well as all other plots depending on that data). The coordinates of the cursor with respect to the
axes of the plot layer are displayed in a text field that floats along with the mouse cursor.

3.9 The Analysis Menu

The commands available in this menu change depending upon whether a table, a matrix or a plot is selected.

3.9.1 Commands for the analysis of data in tables

3.9.1.1 Sort Column

The commands in this menu can be used to sort the selected column(s).

3.9.1.1.1 Ascending

The Analysis -> Sort Column -> Ascending command sorts the selected column or columns in ascending order. If the selection
contains more than one column they are sorted independently.

3.9.1.1.2 Descending

The Analysis -> Sort Column -> Descending command sorts the selected column or columns in descending order. If the selection
contains more than one column they are sorted independently.
The QtiPlot Handbook 86 / 452

3.9.1.1.3 Custom...

The Analysis -> Sort Column -> Custom... command becomes available if there are more than one column selected. This
command opens the Sorting Options dialog. In this dialog you have the option to sort the selected columns:

• separately: each column will be sorted independently in ascending or descending order


• together: the column selected as the leading column will be sorted into ascending or descending order. The other selected
columns will be sorted so as to keep the rows unchanged.

3.9.1.2 Sort Table

The Analysis -> Sort Table command opens the Sorting Options dialog. It functions in the the same manner as the Custom...
command, except that it operates on all columns of the active table.

3.9.1.3 Normalize

These commands are used to normalize data in tables. In this case, normalization is the process of dividing each entry in
the column by the column’s maximum positive value, making the maximum range value equal to 1. Data is not re-centered
so negative values will remain negative and the minimum value may be less than -1. Columns are normalized separately.
The command does not create new columns for the normalized data but replaces the values in the selected columns with their
normalized values. There are 2 variants of this command:

3.9.1.3.1 Normalize -> Columns

The Analysis -> Normalize -> Normalize -> Columns command normalizes only the selected column or columns. If you want
the normalized data in a new column, use the Add Column command to create a new column, fill it using a "copy/paste" sequence
and then normalize the new column.

3.9.1.3.2 Normalize -> Table

The Analysis -> Normalize -> Normalize -> Table command normalizes all the columns of the table. It is not a global normal-
ization of all values of the table: each column is normalized separately.

3.9.1.4 Differentiate

The Analysis -> Differentiate command computes the derivative of the selected Y columns using centered finite differences. A
new plot is created displaying the result of the numerical differentiation. This command creates a new (hidden) table that contains
one column of X-values and one column of derivatives of the Y-values.

3.9.1.5 Integrate...

The Analysis -> Integrate... command computes the integral of the selected Y column using the trapezoidal rule. This command
opens the Integration Options dialog that allows to specify the data range to be integrated.
The QtiPlot Handbook 87 / 452

3.9.1.6 FFT...

The Analysis -> FFT... command computes a direct or inverse Fast Fourier Transform. The parameters used can be set with the
FFT dialog. See the fft section of the Analysis chapter for more details.

3.9.1.7 Correlate

The Analysis -> Correlate command computes the cross-correlation of the two selected columns. See the correlate section of
the Analysis chapter for more details.

3.9.1.8 Autocorrelate

The Analysis -> Autocorrelate command computes the cross-correlation of the selected column with itself (auto-correlation).
See the correlate section of the Analysis chapter for more details.

3.9.1.9 Convolute

Does a convolution of two selected columns. The first one being the response and the second the signal. See the convolution
section of the Analysis chapter for more details.

3.9.1.10 Deconvolute

The Analysis -> Deconvolute command computes the deconvolution of two selected columns. The first one being the response
and the second the signal. See the deconvolution section of the Analysis chapter for more details.

3.9.1.11 Analysis -> Fitting

The Analysis -> Fitting menu provides the following data fitting routines for tables:

3.9.1.11.1 Fit Slope

The Analysis -> Fitting -> Fit Slope command performs a linear fit of the selected curve, using the f(x) = A*x function and the
default data fit settings.

3.9.1.11.2 Fit Linear (Default)

The Analysis -> Fitting -> Fit Linear (Default) command performs a linear fit of the selected curve, using the default data fit
settings. The results will be given in the Log panel.

3.9.1.11.3 Multiple Linear Regression...

The Analysis -> Fitting -> Multiple Linear Regression... command opens the Multiple Linear Regression dialog.

3.9.1.11.4 Fit Wizard... (Ctrl-Y)

Opens the Fit Wizard dialog, allowing you to choose the curve to fit, the algorithm and tolerance to use, and the number of
iterations to be performed. You also enter the analytical function, the names of the fitting parameters and their initial (guessed)
values. See the Data Fitting section of the Analysis chapter for more details.
The QtiPlot Handbook 88 / 452

3.9.2 Commands for the analysis of curves in plots

The following items are enabled only if the active window is a 2D Multilayer Plot Window. If the active plot layer contains more
than one curve, and the Data Range Selectors are not enabled, a dialog window will pop-up allowing you to select the curve you
want to analyze.
In most cases (except for integration), a new red curve is added to the active plot layer and a new table containing the data used
to plot this curve is added to the workspace. Useful information about the operation performed will be shown in the Results Log
display.
The commands for theFFT... and Fit Wizard... are presented in the Table Analysis Menu.

3.9.2.1 Translate

This next group of are 2 commands are used for translating curves horizontally and vertically.

3.9.2.1.1 Vertical

The Analysis -> Translate -> Vertical command is used to move a curve in the vertical direction. When the command is selected,
the cursor changes to a box and cross with an X-Y coordinate display which floats along with the cursor. You then select 2 points.
The first must be a point on a curve. When the first points is selected, a crosshair will be drawn to indicate it’s location. The
second point can then be selected anywhere in the active graph region. The vertical distance between the selected points will be
calculated, and the selected curve will be translated by this amount. The net result is to place the selected graph point at the new
vertical location. Horizontal distance is ignored. This allows selection of the second point at one of the vertical axes, facilitating
alignment of the selected graph point with some value on that axis. The second point may also be another curve point (either on
the same or a different curve), a feature which makes it easy to align two or more curves in the vertical direction. Warning: the
underlying curve’s data is modified by this operation. No other warning will be given.

3.9.2.1.2 Horizontal

The Analysis -> Translate -> Horizontal command is used to move a curve in the horizontal direction. When the command is
selected, the cursor changes to a box and cross with an X-Y coordinate display which floats along with the cursor. You then select
2 points. The first must be a point on a curve. When the first points is selected, a crosshair will be drawn to indicate it’s location.
The second point then can be selected anywhere on the active graph region. The horizontal distance between the selected points
will be calculated, and the curve will be translated horizontally by this amount. The net result is to place the selected graph
point at the new location. Vertical distance is ignored. This allows selection of the second point at one of the horizontal axes,
facilitating alignment of the selected graph point with some value on that axis. The second point may also be another curve point
(either on the same or a different curve), a feature which makes it easy to align two or more curves in the horizontal direction.
Warning: the underlying curve’s data is modified by this operation. No other warning will be given.

3.9.2.2 Subtract

The Subtract group is also used to translate curves, however, in these cases, some functional relationship is used.

3.9.2.2.1 Subtract -> Baseline

The Analysis Subtract -> Baseline command opens the Baseline dialog.

3.9.2.2.2 Subtract -> Reference Data

The Analysis Subtract -> Reference Data command opens the Math on Data Sets dialog which makes possible to perform
arithmetic operations on data curves.
The QtiPlot Handbook 89 / 452

3.9.2.2.3 Subtract -> Straight Line

The Analysis Subtract -> Straight Line command operates in a manner similar to the Analysis -> Subtract -> Baseline com-
mand. However, in this case, the two points which are selected define the end-points of a straight line which is subtracted from
all the curves on the layer.The cursor changes to a cross target with an X-Y coordinate display which floats along with the cursor,
similar to that used in the Analysis -> Subtract -> Baseline command. When the first point is selected, it will be marked with a
small circle and crosshairs. As soon as the second point is selected, the line between the two points will be subtracted from the
curves. Warning: the underlying curves’ data is modified by this operation. No other warning will be given.

3.9.2.3 Peaks...

The Analysis -> Peaks... command opens the Find Peaks dialog.

3.9.2.4 Differentiate

The Analysis -> Differentiate command creates a new plot displaying the resulting curve of the numerical differentiation. The
computation of the derivative is done by centered finite differences. A new table is created which contains one column for
X-values and one column for derivatives of Y-values. It also creates a new plot of the derivative.

3.9.2.5 Integrate...

The Analysis -> Integrate... command performs a piecewise numerical integration of a curve on the selected layer. Curves are
integrated using the trapezoidal rule. There must be at least one curve on the plot layer. This command opens the Integration
Options dialog that allows to specify the data range to be integrated.

3.9.2.6 Integrate Function...

The Analysis -> Integrate Function... command provides the capability of performing the numerical integration of a user defined
function. The Integrate Function dialog is opened when this command is executed. This dialog provides for the definition of
the function, the variable of integration, and the parameters that control the integration. Integration is performed using the
QAGS algorithm from the GNU Scientific Library. For many functions, all you need do is set the limits of integration and click
the "Integrate" button. The default values for the other parameters will usually produce excellent results. For some functions,
especially those containing singularities and discontinuities, you may need to experiment with the number of sub-intervals and
the tolerance limit to obtain acceptable results. However, a detailed discussion of the use of these 2 parameters is beyond the
scope of this manual. If the Plot Area option is checked, a curve of the integrated function will be added to the currently active
layer. In any case, an entry is made in the Log Panel which contains the numerical result of the computed definite integral over
the specified interval.

3.9.2.7 Smooth

There are 4 variants of the Smooth menu item:


The QtiPlot Handbook 90 / 452

Figure 3.2: Comparison of the curve smoothing methods available in QtiPlot applied to a simulated sine curve with added white
noise.

3.9.2.7.1 Savitski-Golay...

The Analysis -> Smooth -> Savitsky-Golay... command performs a smoothing of the selected curve using the Savitzky-Golay
method. The formula used to smooth the curve defined by the points yi =f(xi ) is:

The fi values are computed by fitting the data points to a polynomial. They depend on the number of points used for the smoothing
of the curve and the order of the polynomial. Compared to the moving window average method, the advantage of this smoothing
method is that the values of extrema are not truncated. The dialog allows specification of the curve which will be smoothed, the
order of the polynomial, the number of data points used for the polynomial fit before and after each point, and the color used to
draw the smoothed curved. A new table will be created to store the data points xi , zi .

Figure 3.3: The Smooth -> Savitsky-Golay... dialog.


The QtiPlot Handbook 91 / 452

3.9.2.7.2 Moving Window Average...

The Analysis -> Smooth -> Moving Window Average... command performs a smoothing of the selected curve with the moving
window average method. The formula used to smooth the curve defined by the points yi =f(xi ) is:

The greater the number of points, n, the smoother the resulting curve zi =f(xi ) will be. The dialog allows specification of the curve
which will be smoothed, the value of n and the color used to draw the smoothed curve. A new table will be created to store the
data points xi , zi .

Figure 3.4: The Smooth -> Moving Window Average... dialog.

3.9.2.7.3 Lowess...

The Analysis -> Smooth -> Lowess... command performs a smoothing of the selected curve using the Lowess (aka Loess)
algorithm. It provides a robust locally weighted regression and is well suited to smooth data for which no formal model exists.
The parameter f is the fraction of points which define the local neighborhood. A value of 0.2 uses 20% of the curve total points
as neighbors for each data point (+/- 10%). Values of f closer to 1 yield smoother curves. The iterations parameter specifies
the number of times to run the algorithm runs over the entire data set, each time refining the local weights. In most cases, two
iterations will be sufficient.

Figure 3.5: The Smooth -> Lowess... dialog.

3.9.2.7.4 FFT Filter...

The Analysis -> Smooth -> FFT Filter... command performs a smoothing of the selected curve using the Low Pass method. The
number of points specified is used to calculate a cut-off frequency. The dialog also allows specification of the curve which will
be smoothed and the color used to draw the smoothed curve. A new table will be created to store the data points of the smoothed
curve.
The QtiPlot Handbook 92 / 452

Figure 3.6: The Smooth -> FFT Filter... dialog.

3.9.2.8 FFT Filter

The Analysis -> FFT Filter menu item provides Lowpass, Highpass, Bandpass and Bandreject filter topologies:

3.9.2.8.1 Low Pass...

The Analysis -> FFT Filter -> Low Pass... command uses an FFT based digital filter to attenuate the high frequencies present
in an input signal. See the filtering section for more details. This command opens the FFT Filter Dialog with the filter type set to
Low Pass FFT Filter. In this dialog you can select the curve (input signal) to filter and the cut-off frequency of the filter.

Figure 3.7: The FFT Filter -> Low Pass... dialog.

This command creates a new table containing the filtered data, and adds a new curve to the current layer. The curve is a plot of
the filtered data.

3.9.2.8.2 High Pass...

The Analysis -> FFT Filter -> High Pass... command uses an FFT based digital filter to attenuate the low frequencies present
in an input signal. See the filtering section for more details. This command opens the FFT Filter Dialog with the filter type set to
High Pass FFT Filter. In this dialog you can select the curve to filter and the cut-off frequency of the filter.
The QtiPlot Handbook 93 / 452

Figure 3.8: The FFT Filter -> High Pass... dialog.

This command creates a new table containing the filtered data, and adds a new curve to the current layer. The curve is a plot of
the filtered data.

3.9.2.8.3 Band Pass...

The Analysis -> FFT Filter -> Band Pass... command uses an FFT based digital filter to attenuate both high and low frequencies
present in an input signal. See the filtering section for more details. This command opens the FFT Filter Dialog with the filter
type set to Band Pass FFT Filter. In this dialog you can select the curve to filter and both the low and high cutoff frequencies of
the filter.

Figure 3.9: The FFT Filter -> Band Pass... dialog.

This command creates a new table containing the filtered data, and adds a new curve to the current layer. The curve is a plot of
the filtered data.

3.9.2.8.4 Band Block...

The Analysis -> FFT Filter -> Band Pass... command uses an FFT based digital filter to remove a band of frequencies from a
signal while leaving those frequencies above and below the stop band. See the filtering section for more details. This command
opens the FFT Filter Dialog with the filter type set to Band Block FFT Filter. In this dialog you can select the curve to filter and
both the lower and upper stop-band frequencies of the filter.
The QtiPlot Handbook 94 / 452

Figure 3.10: The FFT Filter -> Band Block... dialog.

This command creates a new table containing the filtered data, and adds a new curve to the current layer. The curve is a plot of
the filtered data.

3.9.2.8.5 Math on Data Sets...

The Analysis -> Math on Data Sets... command opens the Math on Data Sets dialog which makes possible to perform arithmetic
operations on data curves.

3.9.2.8.6 Average Multiple Curves...

The Analysis -> Average Multiple Curves... command opens the Average Multiple Curves dialog which makes possible to
average multiple input curves in order to create a new one.

3.9.2.8.7 Intersections...

The Analysis -> Intersections... command opens the Intersections dialog which can be used in order to find the intersections
between the curves in the active plot layer.

3.9.2.9 Interpolate...

The Analysis -> Interpolate... command performs an interpolation using the selected method. The curve must have enough data
points to compute interpolated points, if not a warning message will be popped up.
The available interpolation methods are Linear (the curve must contain at least 3 points), Cubic Spline (the curve you analyze
must contain at least 4 points), Non-rounded Akime spline (the curve you analyze must contain at least 5 points). See the Analysis
chapter for a comparison of the different methods.

Figure 3.11: The Interpolate... dialog.


The QtiPlot Handbook 95 / 452

This command creates a new curve on the current layer, and a new table.

3.9.2.10 FFT...

The Analysis -> FFT... command performs a forward or inverse FFT of the selected curve. The parameters used can be set with
the FFT dialog.
The inverse FFT transform of a forward transform will result in a data set identical to that used for the forward transform.

3.9.2.11 Analysis -> Fitting

The Analysis -> Fitting menu provides the following data fitting routines for plot curves:

3.9.2.11.1 Fit Slope

The Analysis -> Fitting -> Fit Slope command performs a linear fit of the selected curve, using the f(x) = A*x function and the
default data fit settings.

3.9.2.11.2 Fit Linear (Default)

The Analysis -> Fitting -> Fit Linear (Default) command performs a linear fit of the selected curve, using the default data fit
settings. The results will be given in the Log panel.

3.9.2.11.3 Fit Linear...

The Analysis -> Fitting -> Fit Linear... command opens the Linear Fit Options dialog, allowing to choose the curve to fit, the
number of points for the resulting curve and the abscissa limits for the fit as well as some other data fit options.

3.9.2.11.4 Fit Polynomial...

The Analysis -> Fitting -> Fit Polynomial... command opens the Polynomial Fit Options dialog, allowing to choose the curve
to fit, the order of the polynomial function to use, the number of points of the resulting curve and the abscissa limits for the fit.

3.9.2.11.5 Fit Exponential Decay

Fit Exponential Decay provides 3 forms of exponential decay:

3.9.2.11.5.1 First Order...

The Fit Exponential Decay -> First Order... opens the Fit Exponential Decay dialog, allowing you to choose the curve to fit
and the initial guesses for the fit parameters.

3.9.2.11.5.2 Second Order...

The Fit Exponential Decay -> Second Order... opens the Fit Exponential Decay - Second Order dialog, allowing you to choose
the curve to fit and the initial guesses for the fit parameters.

3.9.2.11.5.3 Third Order...

The Fit Exponential Decay -> Third Order... opens the Fit Exponential Decay - Third Order dialog, allowing you to choose
the curve to fit and the initial guesses for the fit parameters.
The QtiPlot Handbook 96 / 452

3.9.2.11.6 Fit Exponential Growth...

Analysis -> Fitting -> Fit Exponential Growth... opens the Fit Exponential Growth Dialog, allowing to choose the curve to fit
and the initial guesses for the fit parameters.

3.9.2.11.7 Fit Boltzmann (sigmoidal)

The Analysis -> Fitting -> Fit Boltzmann (sigmoidal) performs a fit to a Boltzmann function on the selected curve. It can be
used to obtain the correlation equation of an S shaped data set.

3.9.2.11.8 Fit Pseudo-Voigt

Analysis -> Fitting -> Fit Pseudo-Voigt provides two forms of Pseudo-Voigt profile:

3.9.2.11.8.1 PsdVoigt1...

The Fit Pseudo-Voigt -> PsdVoigt1... performs a fit to a PsdVoigt1 function on the selected curve.

3.9.2.11.8.2 PsdVoigt2...

The Fit Pseudo-Voigt -> PsdVoigt2... performs a fit to a PsdVoigt2 function on the selected curve.

3.9.2.11.9 Fit Gaussian

The Analysis -> Fitting -> Fit Gaussian performs a Gaussian fit to the selected curve. It can be used to obtain the correlation
equation of a bell shaped data set.

3.9.2.11.10 Fit Lorentzian

Analysis -> Fitting -> Fit Lorentzian performs a Lorentzian fit to the selected curve. It can be used to obtain the correlation
equation of a bell shaped data set.

3.9.2.11.11 Fit Multi-peak

Fit Multi-peak performs a fit to a sum of profile functions on the selected curve. Four different profiles are available:

3.9.2.11.11.1 Gaussian...

Fit Multi-peak -> Gaussian... performs a fit to a sum of N Gaussian functions on the selected curve.

3.9.2.11.11.2 Lorentzian...

Fit Multi-peak -> Lorentzian... performs a fit to a sum of N Lorentzian functions on the selected curve.

3.9.2.11.11.3 PsdVoigt1...

Fit Multi-peak -> PsdVoigt1... performs a fit to a sum of N Pseudo-Voigt functions on the selected curve.

3.9.2.11.11.4 PsdVoigt2...

Fit Multi-peak -> PsdVoigt2... performs a fit to a sum of N Pseudo-Voigt functions on the selected curve.
The QtiPlot Handbook 97 / 452

3.9.2.11.12 Fit Wizard... (Ctrl-Y)

Opens the Fit Wizard dialog, allowing you to choose the curve to fit, the algorithm and tolerance to use, and the number of
iterations to be performed. You also enter the analytical function, the names of the fitting parameters and their initial (guessed)
values. See the Data Fitting section of the Analysis chapter for more details.

3.9.3 Commands for the analysis of data in matrices

The following items are enabled only if the active window is a matrix window.

3.9.3.1 Integrate

The Analysis -> Integrate command computes the integral of the selected matrix using the trapezoidal rule. The result will be
displayed in the Log panel.

3.9.3.2 FFT...

The Analysis -> FFT... command computes a direct or inverse two dimensional Fast Fourier Transform. The parameters used
can be set with the FFT dialog. See the FFT section of the Analysis chapter for more details.

3.9.3.3 Forward FFT

The Analysis -> Forward FFT command computes a direct two dimensional Fast Fourier Transform. Please beware that the
input matrix will be modified in order to store the amplitudes of the 2D FFT operation.

3.9.3.4 Inverse FFT

The Analysis -> Inverse FFT command computes an inverse two dimensional Fast Fourier Transform. Please beware that the
input matrix will be modified in order to store the amplitudes of the 2D FFT operation.

3.9.3.5 FFT Filter

The Analysis -> FFT Filter menu item provides Lowpass, Highpass, Bandpass and Bandreject filters. QtiPlot uses the two
dimensional FFT method explained in the following article by Paul Bourke: http://paulbourke.net/miscellaneous/dft/.

3.9.3.5.1 Low Pass...

The Analysis -> FFT Filter -> Low Pass... command uses a two dimensional FFT based digital filter to attenuate the high
frequencies present in an input matrix, see the following article by Paul Bourke http://paulbourke.net/miscellaneous/imagefilter/
for more details. This command opens the FFT Filter Dialog with the filter type set to Low Pass FFT Filter. In this dialog you
can select the matrix to filter and the cut-off frequency of the filter. The input matrix will be modified in order to store the filtered
data.

3.9.3.5.2 High Pass...

The Analysis -> FFT Filter -> High Pass... command uses a 2D FFT based digital filter to attenuate the low frequencies present
in an input matrix, see the following article by Paul Bourke http://paulbourke.net/miscellaneous/imagefilter/ for more details.
This command opens the FFT Filter Dialog with the filter type set to High Pass FFT Filter. In this dialog you can select the
matrix to filter and the cut-off frequency of the filter. The input matrix will be modified in order to store the filtered data.
The QtiPlot Handbook 98 / 452

3.9.3.5.3 Band Pass...

The Analysis -> FFT Filter -> Band Pass... command uses a 2D FFT based digital filter to attenuate both high and low
frequencies present in an input signal, see the following article by Paul Bourke http://paulbourke.net/miscellaneous/imagefilter/
for more details. This command opens the FFT Filter Dialog with the filter type set to Band Pass FFT Filter. In this dialog you
can select the matrix to filter and both the low and high cutoff frequencies of the filter. The input matrix will be modified in order
to store the filtered data.

3.9.3.5.4 Band Block...

The Analysis -> FFT Filter -> Band Pass... command uses a 2D FFT based digital filter to remove a band of frequen-
cies from a matrix while leaving those frequencies above and below the stop band, see the following article by Paul Bourke
http://paulbourke.net/miscellaneous/imagefilter/ for more details. This command opens the FFT Filter Dialog with the filter type
set to Band Block FFT Filter. In this dialog you can select the matrix to filter and both the lower and upper stop-band frequencies
of the filter. The input matrix will be modified in order to store the filtered data.

3.10 The Statistics Menu

The commands in this menu are only available if a table window is selected.

3.10.1 Descriptive Statistics

3.10.1.1 Statistics on Columns

The Statistics -> Descriptive Statistics -> Statistics on Columns command creates a new table providing basic statistical infor-
mation about the selected columns in the active table: average, variance, standard deviation, max value, etc...The quantities to be
computed and displayed in the columns of the result table can be customized via the Descriptive Statistics tab of the Preferences
dialog.

If you select several columns in one table, one line of statistical information will be created for each selected column. However,
you can not select columns from different tables and obtain one single table of statistics.
It is possible to edit in place the names of the columns and the range of rows to be analysed by double-clicking the corresponging
cells. However, you can not set different row ranges for different columns. A valid range of rows must be entered in the Rows
column, under the form [startRow:endRow], whith startRow lower than endRow. Entering the value -1 for the endRow means
the whole column.
The QtiPlot Handbook 99 / 452

3.10.1.2 Statistics on Rows

The Statistics -> Descriptive Statistics -> Statistics on Rows command creates a new table providing basic statistical information
about the selected rows in the active table: average, variance, standard deviation, max value, etc. Statistics are calculated only on
numeric data in visible columns. Usually, statistics should be calculated on data of a similar type - Y values for example. This
feature permits selection of only those columns that should be included in the statistical calculation.
It is possible to edit in place the index of the rows to be analysed by double-clicking the corresponging cells.

3.10.1.3 Frequency Count

The Statistics -> Descriptive Statistics -> Frequency Count command calculates the frequency distribution of the data in the
selected column. The Frequency Count dialog is popped up which allows selecting the data range and the bin width. If more
than one column is selected, an error dialog will pop-up.

3.10.1.4 Normality Test (Shapiro-Wilk)...

The Statistics -> Descriptive Statistics -> Normality Test (Shapiro-Wilk)... command computes a Shapiro-Wilk test on the
selected column to determine how well the column conforms to a normal distribution. This command opens the Normality Test
(Shapiro-Wilk) dialog.

3.10.2 Hypothesis-Testing

3.10.2.1 One Sample t-Test...

The Statistics -> Hypothesis Testing -> One Sample t-Test... command performs a Student’s t-test on the selected column of
data to estimate the statistical likelihood that the mean has a specific value. This command opens the One sample t-Test dialog.

3.10.2.2 Two Sample t-Test...

The Statistics -> Hypothesis Testing -> Two Sample t-Test... command performs a Student’s t-test on two selected columns of
data to estimate the statistical likelihood that the means are the same. This command opens the Two sample t-Test dialog.

3.10.2.3 Chi-square Test for Variance...

The Statistics -> Hypothesis Testing -> Chi-square Test for Variance... command performs a Chi-square test on the selected
column of data to estimate the statistical likelihood that the variance has a specific value. This command opens the Chi-square
Test dialog.

3.10.3 ANOVA

3.10.3.1 One-Way ANOVA...

The Statistics -> ANOVA -> One-Way ANOVA... command performs a one-way analysis of variance on the selected columns
of data. This command opens the One-Way ANOVA dialog.

3.10.3.2 Two-Way ANOVA...

The Statistics -> ANOVA -> Two-Way ANOVA... command performs a Two-way analysis of variance on the selected columns
of data. This command opens the Two-Way ANOVA dialog.
The QtiPlot Handbook 100 / 452

3.10.4 Nonparametric Tests

3.10.4.1 One Sample Wilcoxon Signed Rank Test...

The Statistics -> Nonparametric Tests -> One Sample Wilcoxon Signed Rank Test... command can be used in order to determine
whether the median of a data sample is equal to a specific value. This command opens the One Sample Wilcoxon Signed Rank
Test dialog.

3.10.4.2 Paired Sample Sign Test...

The Statistics -> Nonparametric Tests -> Paired Sample Sign Test... command can be used in order to test for consistent
differences between pairs of observations. This command opens the Sign Test dialog.

3.10.4.3 Paired Sample Wilcoxon Signed Rank Test...

The Statistics -> Nonparametric Tests -> Paired Sample Wilcoxon Signed Rank Test... command can be used in order to
determine whether two dependent samples were selected from populations having the same distribution. This command opens
the Paired Sample Wilcoxon Signed Rank Test dialog.

3.10.4.4 Kolmogorov-Smirnov Test...

The Statistics -> Nonparametric Tests -> Kolmogorov-Smirnov Test... command can be used in order to estimate the statistical
likelihood that two samples are drawn from the same distribution. This command opens the Two Sample Kolmogorov-Smirnov
Test dialog.

3.10.4.5 Mann-Whitney Test...

The Statistics -> Nonparametric Tests -> Mann-Whitney Test... command can be used in order to determine whether two
independent samples were selected from populations having the same distribution. This command opens the Mann-Whitney Test
dialog.

3.10.4.6 Kruskal-Wallis ANOVA...

The Statistics -> Nonparametric Tests -> Kruskal-Wallis ANOVA... is a method for testing whether several samples originate
from the same distribution. This command opens the Kruskal-Wallis ANOVA dialog.

3.10.4.7 Mood’s Median Test...

The Statistics -> Nonparametric Tests -> Mood’s Median Test... is a method for testing whether several samples originate from
the same distribution. This command opens the Mood’s median test dialog.

3.10.4.8 Friedman ANOVA...

The Statistics -> Nonparametric Tests -> Friedman ANOVA... is a method for testing whether several samples originate from
the same distribution. This command opens the Friedman ANOVA dialog.

3.11 The Table Menu

This menu is only active when a table is selected.


The QtiPlot Handbook 101 / 452

3.11.1 Set Column As

Selecting the Set Column As item opens a sub-menu of command that are used to define the kind of data stored in the various
columns of a table.

3.11.1.1 Set Column As -> X

Define the selected column as abscissa for the plots. You can define more than one column as X-values in a table, they are
referenced as X1, X2, etc.

3.11.1.2 Set Column As -> Y

For 2D plots, this command defines the selected column as Y-values for the plots. For 3D plots, Y columns can be used as the
second abscissa.

3.11.1.3 Set Column As -> Z

For 3D plots, Z columns will be used as plotted values.

3.11.1.4 Set Column As -> X error

Define the selected column for use as the error bar width for the abscissae.

3.11.1.5 Set Column As -> Y error

Define the selected column for use as the error bar heights for the Y-values.

3.11.1.6 Set Column As -> Read-only

Set the selected columns as read-only.

3.11.1.7 Set Column As -> Read/Write

Restore write access to the selected columns.

3.11.1.8 Set Column As -> label

Sets the selected columns as label columns. Can be used for comments and row descriptions.

3.11.1.9 Set Column As -> Disregard

No special function is assigned. The selected column can be used in different ways in several plots (as X values, Y values, etc).
These columns are disregarded in statistical calculations.

3.11.2 Column Options...

This command is used to define the global parameters of each column such as numeric format, column name, etc. See the
corresponding dialog box section for more details.
The QtiPlot Handbook 102 / 452

3.11.3 Set Column Values...

This command is used to fill the selected column with the values resulting from a mathematical formula. See the corresponding
dialog box section for more details.

3.11.4 Recalculate

When you fill a column (named for example ’C1’) with the results of a formula (by using the Set Column Values... command),
the values of the column are calculated only once when you define the formula. If your formula depends on values of another
column (name for example ’C2’), the values of ’C1’ are not updated if you modify the values in ’C2’. This command is used to
recalculate the values of the selected column.

3.11.5 Fill column with

These commands are used to fill selected columns with special values:

3.11.5.1 Fill Column With -> Row Numbers

Each element in the column is filled with its corresponding row number.

3.11.5.2 Fill Column With -> Random Numbers

Each element in the column is filled with a random value between 0 and 1.

3.11.5.3 Fill Column With -> Normal Random Numbers

The rows in the selected column are filled with normally distributed random values calculate using the Ziggurat method with a
mean of 0.0 and a standard deviation of 1.0. The computational routine is from the Gnu Scientific Library (look here for more
details).

3.11.6 Clear

Removes all the values of the selected column.

3.11.7 Add Column

Adds a new column to the table. Regardless the selected column, new columns are inserted to the right of the rightmost column
in the table.

3.11.8 Insert Column

Inserts a new column to the left of the selected column(s) in the active table. This action is enabled only if there is at least one
column selected in the active table.

3.11.9 Columns...

Used to define the number of columns in the table. Columns are added/removed from the right hand side of the table. Be Careful!
If you decrease the number of columns in a table, any data contained in the removed columns will be lost!
The QtiPlot Handbook 103 / 452

3.11.10 Duplicate Columns

Duplicates the selected columns in the table. The new columns are appended to the table and have the same properties and values
as the source columns, except the name.

3.11.11 Hide Selected Columns

The Hide Selected Columns command hides all the selected columns. The remaining visible columns are grouped together into
a single block. Hidden columns may be shown using the Show All Columns command.

3.11.12 Show All Columns

The Show All Columns command unhides any hidden columns in the selected table.

3.11.13 Alignment

These commands are used to cusomize the alignment of the texts in the selected columns:

3.11.13.1 Alignment -> Left

The texts in the selected columns are aligned with the left edge of the columns.

3.11.13.2 Alignment -> Center

The texts in the selected columns are centered horizontally in the available space.

3.11.13.3 Alignment -> Right

The texts in the selected columns are aligned with the right edge of the columns.

3.11.14 Adjust Column Width

The Adjust Column Width command resets the width of all selected columns to a value that is optimal for the data that is
contained in the column. Optimal width is considered to be just wide enough to show all digits.

3.11.15 Move to First

Moves the selected column to the beginning of the table.

3.11.16 Move Left

Moves the selected column to the left.

3.11.17 Move Right

Moves the selected column to the right.


The QtiPlot Handbook 104 / 452

3.11.18 Move to Last

Moves the selected column to the end of the table.

3.11.19 Swap columns

Swaps the selected columns.

3.11.20 Rows...

Allows direct definition of the number of rows in the table. Rows are added/removed from the end of the table.

3.11.21 Delete Rows Interval...

This command opens a dialog that permits selection, and subsequent deletion, of a range of rows selected by row index number:

3.11.22 Insert Row

Inserts a new row above the selected row in the active table. This operation works only if there is at least one row selected in the
active table.

3.11.23 Move Row

These commands are used to move selected rows up or down in a table:

3.11.23.1 Move Row -> UP

The selected row is moved up one place in the table.

3.11.23.2 Move Row -> DOWN

The selected row is moved down one place in the table.

3.11.24 Go to Row... (Ctrl-Alt-G)

This command opens a dialog which allows you to select the row index that will become the current row in the selected table or
matrix.
The QtiPlot Handbook 105 / 452

3.11.25 Go to Column... (Ctrl-Alt-C)

This command opens a dialog which allows you to select the column index that will become the current column in the selected
table or matrix.

3.11.26 Extract Data...

The Extract Data... command opens a dialog which allows you to define a set of conditions that are used to filter the data in the
currently active table. When a condition has been defined, Applying the condition will create a new table into which all rows that
meet the condition will be copied. The original table is unchanged. For example, the condition col("1") > 0.5 will generate a
new table that contains all the rows from the active table which have a value greater than 0.5 in column 1. See the corresponding
dialog box section for more details.

3.11.27 Convert to Matrix

The commands in this submenu may be used to convert a table into a matrix. Their main utility might be to import data from
files into matrices: first import the data into a table and then use these commands to convert the table into a matrix.

3.11.27.1 Convert to Matrix -> Direct

This command creates a new matrix having the same dimensions (rows/columns) as the input table. Each cell in the table has its
corresponding cell in the resulting matrix. There are no special requirements on the data values in the table to be converted.

3.11.27.2 Convert to Matrix -> 2D Binning...

This command bins XY data, meaning that it creates a frequency count of the data points falling within a given XY range and
stores the bin counts as Z values in a new matrix. It opens the the Bin Matrix Dialog that allows to customize the new matrix in
terms of dimensions and coordinates. The input data must be a single Y column that has a X column associated to it.

3.11.27.3 Convert to Matrix -> Regular XYZ...

This command opens the Regular XYZ Gridding dialog that allows to customize the process of generating a new matrix from a
table that contains regularly spaced XY data.

3.11.27.4 Convert to Matrix -> Random XYZ...

Opens the the Random XYZ Gridding dialog that allows to customize the process of generating a new matrix from a collection
of randomly distributed XYZ data samples, using Shepard’s method. The input data must be a single Z column that has a X and
a Y column associated to it.

3.12 The Matrix Menu

This menu is only active when a matrix is selected.

3.12.1 Set Properties...

This command opens a dialog window which is used to specify some view parameters of the matrix (cell width, format of
numbers).
The QtiPlot Handbook 106 / 452

3.12.2 Set Dimensions... (Ctrl-D)

This command opens a dialog window which is used to specify the size of a matrix. It can also be used to specify the X and Y
ranges which will be used as axis ranges for a 3D-plot of the matrix data.

3.12.3 Set Values... (Ctrl-Q)

This command opens a dialog window which is used to fill in a matrix with the result of a function z=f(i,j) in which i and j stand
for the row and column numbers.

3.12.4 Recalculate (Ctrl-Return)

This command allows you to recalculate the matrix cell values using a predefined formula. Useful when the formula is changed.

3.12.5 Rotate 90 (Ctrl-Shift-R)

This command performs a clockwise 90 degrees rotation of the active matrix.

3.12.6 Rotate -90 (Ctrl-Alt-R)

This command performs a counterclockwise 90 degrees rotation of the active matrix.

3.12.7 Flip V (Ctrl-Shift-V)

Flips the selected matrix vertically.

3.12.8 Flip H (Ctrl-Shift-H)

Flips the selected matrix horizontally.

3.12.9 Expand...

Opens the matrix resampling dialog. Expanding operation is preselected in the dialog.

3.12.10 Shrink...

Opens the matrix resampling dialog. Shrinking operation is preselected in the dialog.

3.12.11 Smooth

Matrix smoothing is performed by shrinking and then expanding the matrix using bilinear interpolation. If the number of columns
or rows is less than 32, the matrix is first expanded so that the row number and the column number are both twice of the original.
Then the expanded matrix is shrunk to the original size. Through this process of expanding and shrinking, the size of the output
matrix will be exactly the same as the original matrix. However, the data will be much smoother. If both the number of columns
and the number of rows in the original matrix are greater than 31, the matrix is first shrunk and then expanded to obtain the
smoothed matrix.

3.12.12 Transpose

Perform a Transpose operation on the selected matrix.


The QtiPlot Handbook 107 / 452

3.12.13 Invert

Invert the selected matrix.

3.12.14 Determinant

Compute the determinant of the selected matrix.

3.12.15 Go To Commands

The Go to Row... and Go to Column... commands are the same as those described in the Table menu

3.12.16 View Commands

This group of commands allows you to choose how the matrix will be displayed.

3.12.16.1 Image mode (Ctrl-Shift-I)

Displays the selected matrix as an image.

3.12.16.2 Data mode (Ctrl-Shift-D)

Displays the selected matrix as a data table.

3.12.17 Palette

3.12.17.1 Gray Scale Map

If the selected matrix is viewed as an image, this command sets the palette to a gray scale.

3.12.17.2 Rainbow

If the selected matrix is viewed as an image, this command sets the palette to a predefined color scale.

3.12.17.3 Custom

Opens the Custom Color Map dialog allowing customization of the palette used by the selected matrix when the matrix is
displayed as an image.

3.12.18 Show Column/Row (Ctrl-Shift-C)

When this option is checked, the horizontal and vertical headers of the selected matrix will display the column/row indexes.

3.12.19 Show X/Y (Ctrl-Shift-X)

When this option is checked, the horizontal and vertical headers of the selected matrix will display the x/y coordinates.
The QtiPlot Handbook 108 / 452

3.12.20 Convert to Spreadsheet

Convert the selected matrix into a table.

3.13 The Format Menu

This menu is only active when a plot is selected.

3.13.1 Apply Template...

Opens an existing QtiPlot template file (.qpt) and applies it to the active plot window.

3.13.2 Copy Format (Shift-F)

This command is available only for 2D and 3D plot windows and is used to copy the format from the active plot window. The
copied format can be applied afterwards using the Paste Format command.

3.13.3 Set As Default

This command is available only for 2D and 3D plot windows and is used to save the current settings of the active plot window as
the global preferences. These settings can be viewed and customized using the Preferences... command.

3.13.4 Edit Range...

Opens the Edit Curve Range dialog for 2D plots. It is used to customize the visible data range of the curves in the active 2D plot
layer. This dialog can be opened only if there is a selected data curve in the active plot layer.

3.13.5 Plot Associations...

Opens the Plot Associations dialog for 2D plots. It is used to select the columns of a table to be used as X, Y and error values for
the plot curves in the active 2D plot layer. This dialog is only available if the active plot layer contains data curves.

3.13.6 Plot...

For classical 2D plots, opens the format plot dialog with the general plot options tab selected. It is used to customize line styles
and colors of the plot frame, etc.
For surface plots, this command opens the surface plot options with the general plot options tab selected. In this case the aspect
ratio of the plot can also be modified.

3.13.7 Curves...

Opens the Custom Curves dialog. Used to customize the line style and colors used to draw curves.
If the selected plot is a surface plot, this menu item is not shown.

3.13.8 Scales...

Opens the format plot dialog with the scales tab selected. Used to customize the ranges on the different axes. Note that any
modification in an associated table, or of the plotted curves, will result in a reset of these scales to the default values.
For surface plots, this command opens the surface plot options with the scales options tab selected.
The QtiPlot Handbook 109 / 452

3.13.9 Axes...

Opens the format plot dialog with the axes tab selected. Used to customize the settings for the different axes, such as axis/tick
size and color, axis labels, etc.
For surface plots, this command opens the surface plot options with the axis options tab selected.

3.13.10 Grid...

Opens the format plot dialog with the grid tab selected. Used to add and customize grid lines on the different axes.
This menu item is not shown for surface plots.

3.13.11 Title...

Opens a text options dialog, which permits modification of text and properties (color, font, alignment) of the plot title.
For surface plots, this command opens the surface plot options with the title options tab selected.

3.14 The Windows Menu

In addition to the items listed below, this menu will also display a list containing the first ten windows created in the workspace.
These windows can be made active, or can be shown if they are hidden, by selecting their name from the list. If your project
contains more then ten windows, you must use the Project explorer in order to perform these operations on the remaining
windows.

3.14.1 Folders

Opens a menu displaying a list of all the folders and subfolders in the project. The active folder is highlighted. You can change
the active folder in a project by selecting an item from this list.

3.14.1.1 Properties

This command opens the Folder Properties dialog making possible to edit the name and comments of the current project folder.

3.14.2 Cascade

Arranges the visible windows in the project in a cascading style.

3.14.3 Tile

Tiles the visible windows in the project.

3.14.4 Next (F5)

Makes the next visible window in the workspace stack the active window.

3.14.5 Previous (F6)

Makes the previous visible window in the workspace stack the active window.
The QtiPlot Handbook 110 / 452

3.14.6 Find...

Opens the Project Explorer Find dialog which permits searching a window anywhere in the project.

3.14.7 Rename Window

Opens the Window Properties dialog permitting you to change the title (name and/or label) or to set comments for the currently
active window.

3.14.8 Copy Window (Shift-W)

This command can be used in order to copy the active window, which can be afterwards pasted to a different project folder. If
the active window is a 2D or a 3D plot window, this command also stores an image of the plot in the global clipboard, image that
can be pasted to an Excel or LibreOffice document, for example.

3.14.9 Duplicate

Clones the active window.

3.14.10 Script Window (F3)

Opens the script console window.

3.14.11 Window Geometry...

Opens a dialog used to change the size and the position of the active window. The size of any contained plots will be scaled to
the new window size.

3.14.12 Hide Window

Hides the active window. A hidden window can be made visible again using the Project explorer.

3.14.13 Close Window (Ctrl-W)

Closes the active window. A dialog will pop-up asking you to confirm the operation if the corresponding option in the Preferences
dialog ("Confirmations" tab) is checked.

3.14.14 Numbered Window List

A numbered list of the current folder’s windows appears at the bottom of the Window Menu. This list may contain up to 9 entries.
Clicking on one of the entries in this list will activate that window (that is, display the window, and unhide it if necessary. If there
are more than 9 entries, the More Windows... command will be added to the Window Menu immediately following the last item
in the numbered window list. Selecting the More Windows... command opens the Project Explorer, which provides access to all
windows in all folders in the project.

3.15 The Help Menu

3.15.1 Help

This command opens the QtiPlot help browser window.


The QtiPlot Handbook 111 / 452

3.15.2 Choose Help Folder...

This command opens a file dialog allowing to choose the folder where the QtiPlot help files (qtiplot.qch and qtiplot.qhc) can be
found.

3.15.3 QtiPlot Homepage

This command opens the default browser on your system and takes you to the official QtiPlot web page.

3.15.4 Download Manual

This command opens the default browser on your system and takes you to the download page for the PDF version of the QtiPlot
user manual.

3.15.5 Search for Updates...

Opens a dialog box asking for permission to connect to the QtiPlot website and get information about the latest release number
available.

3.15.6 Changelog...

Opens a message box with information about the modifications (bug fixes and new features) available in the current QtiPlot
version as well as in the past releases. The online version of this changelog can be found on the QtiPlot website, splitted into two
pages the latest news and the the archived news.

3.15.7 About QtiPlot... (F1)

Opens a message box with information about the current QtiPlot version and architecture (32-bit or 64-bit), its release date and
the Qt and Python versions used to build QtiPlot.

3.16 Customization of 3D plots

These commands are not available in any menu or by using any keyboard shortcut. However, they can be accessed through the
3D toolbar.
The QtiPlot Handbook 112 / 452

3.16.1 Frame

This command can be accessed by a click on the


Draws only the three axes on the active 3D plot.

3.16.2 Box

This command can be accessed by a click on the


Draws the three axes on the active 3D plot, and a box around it.

3.16.3 No axes

This command can be accessed by a click on the


Doesn’t draw the three axes nor the box on the active 3D plot.

3.16.4 Front Grid

This command can be accessed by a click on the


Draws a grid on the front panel of the active 3D plot. The position of this grid is on the plane defined by y=ymin .

3.16.5 Back Grid

This command can be accessed by a click on the


Draws a grid on the back panel of the active 3D plot. The position of this grid is on the plane defined by y=ymax .

3.16.6 Left Grid

This command can be accessed by a click on the


Draws a grid on the left panel of the active 3D plot. The position of this grid is on the plane defined by x=xmin .

3.16.7 Right Grid

This command can be accessed by a click on the


Draws a grid on the right panel of the active 3D plot. The position of this grid is on the plane defined by x=xmax .

3.16.8 Ceiling Grid

This command can be accessed by a click on the


Draws a grid on the top panel of the active 3D plot. The position of this grid is on the plane defined by z=zmax .

3.16.9 Floor Grid

This command can be accessed by a click on the


Draws a grid on the floor panel of the active 3D plot. The position of this grid is on the plane defined by z=zmin .
The QtiPlot Handbook 113 / 452

3.16.10 Enable perspective

This command can be accessed by a click on the


Enables/Disables 3D perspective mode.

3.16.11 Reset rotation

This command can be accessed by a click on the


Resets the rotation of the 3D plot to the default value.

3.16.12 Fit frame to window

This command can be accessed by a click on the


Finds the best layout of the 3D plot to fit the window size. It readjusts the length of the axis ticks to a default value.

3.16.13 Bars Style

This command can be accessed by a click on the


If the active 3D plot is a 3D histogram, this command permits modification of the style used to draw the bars.

3.16.14 Dots

This command can be accessed by a click on the


If the active 3D plot is a 3D scatter, this command permits modification of the style used to draw data points as dots.

3.16.15 Cones

This command can be accessed by a click on the


If the active 3D plot is a 3D scatter, this command permits modification of the style used to draw data points as cones. It it then
possible to modify the drawing parameters of the cones by double clicking on the plotting area.

3.16.16 Cross Hairs

This command can be accessed by a click on the


If the active 3D plot is a 3D scatter, this command permits modification of the style used to draw data points as cross-hairs. It it
then possible to modify the drawing parameters of the crosses by double clicking on the plotting area.

3.16.17 3D Wire Frame

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to modify the style of the surface to be drawn as a simple wireframe.

3.16.18 3D Hidden Lines

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to modify the style of the surface to be drawn as a wireframe. A
computation of hidden lines is performed.
The QtiPlot Handbook 114 / 452

3.16.19 3D Polygons

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to modify the style of the surface to be drawn as polygons.

3.16.20 3D Wire Surface

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to modify the style of the surface to be drawn as polygons with a
mesh.

3.16.21 Floor Data Projection

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to add a filled area projection of the surface on the floor of the plot.

3.16.22 Floor Isolines

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to add an isoline.

3.16.23 Empty Floor

This command can be accessed by a click on the


If the active 3D plot is a 3D surface, this command is used to remove any projection from the floor.

3.16.24 Animation

This command can be accessed by a click on the


Enables/disables animation.
The QtiPlot Handbook 115 / 452

Chapter 4

The Toolbars

Groups of related commands are collected together in a number of toolbars. All toolbars can be moved and docked in a more
convenient location (left, right or bottom sides of the application window) or moved onto the desktop (outside the main window)
using drag-and-drop, using their left side handle. Toolbars are automatically enabled/disabled depending on the currently active
window. For example, if the current window is a table, the Table toolbar will be enabled and all the other toolbars will be
automatically disabled.
The same approach is used for showing/hiding toolbars: if there are no visible tables in the workspace, the Table toolbar will
be automatically hidden. It will be shown again when the user adds a new table into the project. Toolbars can also be manually
shown/hidden at any time by right-clicking on the Toolbars... command from the View menu or entering Ctrl-Shift-T and then
checking/unchecking the corresponding item in the pop-up menu.
Visible toolbars will be shown in one of two possible formats depending upon the space available at the docking location. By
default, when there is sufficient room, all tool icons will be shown in a single row or column. If there is not sufficient room to
show all icons in one row, the toolbar will be collapsed to the extent necessary to fit the toolbar into the available space. In this
case, the ">>" symbol will be shown to indicate that there are hidden command icons. As long as the toolbar is not disabled, left
clicking on the ">>" symbol will temporarily expand the toolbar and show the hidden commands, which may then be left clicked
to execute them. Moving the mouse pointer off of the toolbar will automatically collapse it. Note that toolbars located on the
desktop are always shown expanded.

4.1 The Edit Toolbar

Figure 4.1: The QtiPlot Edit Toolbar

4.2 The File Toolbar

The File Toolbar provides single-click access to commands from the File menu. Refer to this section for a more complete
description of these commands.

Figure 4.2: The QtiPlot File Toolbar


The QtiPlot Handbook 116 / 452

Icon Command Key Description


Undo the last command, this feature doesn’t work for plot mod-
Undo command Ctrl-Z
ifications. See the Undo command command for more details.
Redo the last command, this feature doesn’t work for plot mod-
Redo command Ctrl-Shift-Z
ifications. See the Redo command command for more details.
Cut Selection Ctrl-X Cut the current selection.
Copy Selection command Ctrl-C Copy the current selection.
Paste Selection command Ctrl-V Paste the current selection.
Delete Selection command Del Delete the current selection.

Table 4.1: Edit toolbar commands.

Icon Command Key Description


New Window/Folder Selects the last used window/folder creation command or se-
Commands lects a new one from a drop down list.
New Function/Surface Selects the last used function/surface creation command or se-
Commands lects a new one from a drop down list.
Selects the last used open command or selects a new one from
Open Commands
a drop down list.
Appends an existing QtiPlot project file as a new folder to the
Append Project... command Ctrl-Alt-A
current project.
Save Project command Ctrl-S Saves the current project.
Save as Template command Saves the current graph window as a template.
Import -> Import ASCII...
Ctrl-K Imports ASCII files.
command
Duplicate command Clones the active window.
Print command Ctrl-P Prints the active window.
Print Preview command Previews the active window for printing.
Export to PDF command Ctrl-Alt-P Exports the active window formatted as a PDF file.
Project Explorer Ctrl-E Shows or hides the project explorer.
Results log Shows or hides the results window.
Script Window command F3 Shows the script window.

Table 4.2: File toolbar commands.

Icon Command Key Description


New Project command Ctrl-N Create a new project.
New Folder command F7 Add a new folder.
New Table command Ctrl-T Create a new table.
New Matrix command Ctrl-M Create a new matrix.
New Note command Create a new note window.
New Graph command Ctrl-G Creates a new, empty graph window (2D plot).

Table 4.3: New Window/Folder Commands


The QtiPlot Handbook 117 / 452

Icon Command Key Description


New Function Plot... command Ctrl-F Creates a new plot based on a function Y=f(X).
New Parametric Function Creates a new parametric plot: the (X,Y) data points are com-
Plot... command puted using functions of a variable (m), X=f1(m) and Y=f2(m).
New 3D Surface Plot...
Ctrl-Alt-Z Creates a new 3D plot based on a function Z=f(X,Y).
command
Creates a new 3D parametric plot: the (X,Y,Z) data points are
New 3D Parametric Surface
computed using functions of the latitude and longitude vari-
Plot... command
ables u and v.

Table 4.4: New Function/Surface Commands

Icon Command Key Description


Open command Ctrl-O Opens an existing QtiPlot project file.
Open Template command Opens an existing QtiPlot template file.
Imports an Excel workbook into new tables (and plots if Excel
Open Excel command Ctrl-Shift-E
is installed).
Open ODF Spreadsheet
Ctrl-Alt-S Imports an ODF spreadsheet into new tables.
command

Table 4.5: Open Commands

4.3 The Plot Toolbar

This toolbar is only active when a graph window is selected. It provides single-click access to the commands of the Graph menu
and of the Data menu which are used for the modification of plots and the data points of the plots.

Figure 4.3: The QtiPlot Plot Toolbar

4.4 The Layers Toolbar

This toolbar is only active when a graph window is selected. It provides single-click access to the commands of the Graph menu
which can be used in order to create and manipulate multi-layer 2D graphs.

Figure 4.4: The QtiPlot Layers Toolbar

4.5 The Table Toolbar

This toolbar provides single-click access to the Plot Menu commands. These are used to plot data from tables.
The QtiPlot Handbook 118 / 452

Icon Command Key Description


Add Error Bars... Ctrl-B Adds error bars to a curve on the active plot layer.
Adds curves to, or removes curves from, the active plot win-
Add/Remove Curves... Alt-C
dow.
Add Function... Ctrl-Alt-F Adds a curve based on a function to the active plot layer.
New Legend Ctrl-L Adds a new legend to the active plot layer.
Add Color Scale Adds a new color scale legend to the active plot layer.
Exchange X-Y Axes Swaps the X and Y axes of the the active layer.
Rescale To Show All Ctrl-Shift-R Rescales the axes to show all data points.
Reverts to normal pointer mode. Useful when you have se-
Disable tools lected another pointer mode on a plot layer, such as the data
reader.
Selects the last used zoom tool or selects a new one from a drop
Zoom Commands
down list.
Select Data Range Alt-S Switches the active plot layer into Select Data Range mode.
Selects the last used data reader tool or selects a new one from
Read Data Commands
a drop down list.
Selects the last used data edit tool or selects a new one from a
Edit Data Commands
drop down list.
Selects the last used add text tool or selects a new one from a
Add Text Commands
drop down list.
Selects the last used add arrow/line tool or selects a new one
Add Line/Arrow Commands
from a drop down list.
Selects the last used geometric shape tool or selects a new one
Geometric Shape Commands
from a drop down list.
Selects the last used image tool or selects a new one from a
Image Commands
drop down list.
Selects the last used Z-order tool or selects a new one from a
Z-order Commands drop down list. These tool buttons are available only when one
or more annotation objects are selected in the active plot layer.
Selects the last used alignment tool or selects a new one from
Align Objects Commands a drop down list. These tool buttons are available only when
several annotation objects are selected in the active plot layer.

Table 4.6: Plot toolbar commands


Icon Command Key Description
Zoom In/Out and Drag Canvas Switches the active plot layer into dynamic zoom/drag mode.
Zoom/Drag Canvas Switches the active plot layer into dynamic horizontal zoom/-
Horizontally drag mode.
Switches the active plot layer into dynamic vertical zoom/drag
Zoom/Drag Canvas Vertically
mode.
Zoom in Ctrl-+ Switches the active plot layer into zoom mode.
Zoom out Ctrl-- Zooms the active plot layer out one step in the zoom history.

Table 4.7: Plot Toolbar Zoom Commands


Icon Command Key Description
Data Reader Ctrl-D Switches the data display into Data Reader mode.
Annotation Switches the active plot layer into Annotation mode.
Screen Reader Switches the active plot layer into Screen Reader mode.
Shows a vertical red cursor and opens the Vertical Cursor dialog
Vertical Cursor... Ctrl-Alt-V which gives quick access to the values of the data points for all
curves in a plot layer.

Table 4.8: Read Data Commands


The QtiPlot Handbook 119 / 452

Icon Command Key Description


Draw Data Points Adds new data points on the active plot layer.
Allows drag-mode moving of data points on the active plot
Move Data points Ctrl-Alt-M
layer.
Remove Bad Data Points Alt-B Allows removal of data points from the active plot layer.
Remove Bad Data Points Drags a selected curve around on plot layer.

Table 4.9: Edit Data Commands

Icon Command Key Description


Add Text Alt-T Adds a new text element on the active plot layer.
Add Equation... command Alt-Q Adds a new Tex formatted equation on the active plot layer.
Add Time Stamp Ctrl-Alt-T Adds a time/date label on the active plot layer.

Table 4.10: Add Text Commands

Icon Command Key Description


Draw Arrow Ctrl-Alt-A Adds a new arrow on the active plot layer.
Draw Line Ctrl-Alt-L Adds a new line on the active plot layer.

Table 4.11: Add Line/Arrow Commands

Icon Command Key Description


Add Rectangle Ctrl-Alt-R Adds a new rectangle on the active plot layer.
Add Ellipse Ctrl-Alt-E Adds a new ellipse (circle) on the active plot layer.

Table 4.12: Geometric Shape Commands

Icon Command Key Description


Add Image Alt-I Inserts a new image into the active plot layer.
Gets the pixel intensity from an image in the active 2D plot
layer. The selection of the pixel range from the image is done
View Pixel Line Profile...
manually by drawing a line whose end points must be situated
inside the image.

Table 4.13: Image Commands

Icon Command Key Description


Move to Top Moves the selected item to the top of the layer’s z-order.
Move to Bottom Moves the selected item to the bottom of the layer’s z-order.

Table 4.14: Z-order Commands

Icon Command Key Description


Align Left Aligns selected plot objects along the left edge.
Align Right Aligns selected plot objects along the right edge.
Align Top Aligns selected plot objects along the top edge.
Align Bottom Aligns selected plot objects along the bottom edge.

Table 4.15: Align Objects Commands


The QtiPlot Handbook 120 / 452

Icon Command Key Description


Selects the last used add layer tool or selects a new one from a
Add Layer Commands
drop down list.
Selects the last used add axis tool or selects a new one from a
Add Axis Commands
drop down list.
Opens a dialog for rearranging all layers of the active graph
Arrange Layers... Shift-A
window.
Automatic Layout Automatically rearranges all layers of the active graph window.
Selects the last used fit layers tool or selects a new one from a
Fit Layers Commands
drop down list.
Extract/Merge Layers Selects the last used extract/merge layers tool or selects a new
Commands one from a drop down list.

Table 4.16: Layers toolbar commands

Icon Command Key Description


Add Layer Alt-L Adds a new layer to the active plot window.
Add Empty Inset Layer Adds an empty inset layer to the active graph window.
Adds an inset layer to the active graph window that contains
Add Inset Layer With Curves
copies of any curves in the active plot layer.

Table 4.17: Add Layer Commands

Icon Command Key Description


Add Horizontal Axis Adds a central horizontal axis to the active plot layer.
Add Vertical Axis Adds a central vertical axis to the active plot layer.

Table 4.18: Add Axis Commands

Icon Command Key Description


Adjusts the dimensions of the existing layers to fit the current
Fit Layers to Window window size by shrinking them in both horizontal and vertical
direction.
Adjusts the dimensions of the active 2D plot window in order
Fit Window to Layers
to entirely display all its layers.

Table 4.19: Fit Layers Commands

Icon Command Key Description


Extracts datasets (curves) from the active layer onto separate
Extract to Layers
layers.
Extracts all layers in the active graph window to separate
Extract to Graphs...
graphs.
Opens the Graph Manipulation dialog that allows users to
Merge Graph Windows... choose the graph windows to be merged in a new 2D plot win-
dow.

Table 4.20: Extract/Merge Layers Commands


The QtiPlot Handbook 121 / 452

Figure 4.5: The QtiPlot Table Toolbar

Icon Command Key Description


Line Plots Line, Horizontal Steps, Vertical Steps
Scatter Plots Scatter, Vertical Drop Lines
Line & Symbol Plots Line+Symbol, Spline
Bar Chart Plots Columns, Rows, Stack Column, Stack Bar
plot -> Area Plots selected data using area style.
plot -> 2D Color Pie Chart Plots selected data using pie style.
Box, Interval, Violin, Histogram, Histogram + Probabilities,
Statistical Plots Stacked Histogram, Pareto Chart - Binned Data, Pareto Chart -
Raw Data, Bland-Altman plot, Q-Q plot, Stem-Leaf
Vector Plots Vectors XYXY. Vectors XYAM
Double-Y, Waterfall, Zoom, Vert. 2 Layer, Horiz. 2-Layer, 4
Special Line/Symbol Plots
Layer, Stacked Layer, Custom
3D Plots Bars, Ribbons, Scatter, Trajectory

Table 4.21: Table toolbar commands.

Icon Command Key Description


plot -> Line Plots selected data using line style.
plot -> Horizontal Steps Plots selected data using horizontal steps style.
plot -> Vertical Steps Plots selected data using vertical steps style.

Table 4.22: Line Plots

Icon Command Key Description


plot -> Scatter Plots selected data using scatter style.
Plots a graph of the selected data columns using "Scatter" style
plot -> Scatter Central
and the X and Y axes located in the middle of the layer.
plot -> Vertical Drop Lines Plots selected data using vertical drop lines style.
plot -> Bubble Plots selected data using indexed sizes for the plot symbols.
Plots selected data using a default color map for the plot sym-
plot -> Color Mapped
bols.
plot -> Bubble + Color Plots selected data using indexed sizes and a default color map
Mapped for the plot symbols.

Table 4.23: Scatter Plots

4.6 The Column Toolbar

This toolbar provides single-click access to the commands of the Table Menu which are used to rearrange columns in the table,
fill columns with values and define the plot role of selected columns. A few items from the Analysis menu are also included on
this toolbar.
The QtiPlot Handbook 122 / 452

Icon Command Key Description


plot -> Line+Symbol Plots selected data using line+symbol style.
plot -> Spline Plots the selected data columns using spline style.

Table 4.24: Line & Symbol Plots

Icon Command Key Description


plot -> Columns Plots selected data using columns style.
plot -> Rows Plots selected data using rows style.
plot -> Special Bar/Column ->
Plots selected data using stack column style.
Stack Column
plot -> Special Bar/Column ->
Plots selected data using stack row style.
Stack Bar

Table 4.25: Bar Chart Plots

Icon Command Key Description


plot -> Box Plot Plots selected data using Box style.
plot -> Interval Plot Plots selected data using the interval style.
plot -> Scatter Interval Plots selected data using the scatter interval style.
plot -> Violin Plot Plots selected data using the violin style.
plot -> Violin with Box Plots selected data using the violin with box style.
plot -> Histogram Plots selected data using histogram style.
plot -> Histogram + Plots selected data using histogram style. Additionally, it plots
Probabilities a cumulative sum of observations in a second graph layer.
plot -> Histogram + Plots selected data using histogram style. Additionally, it plots
Probabilities (Double-Y) a cumulative sum of observations using a vertical steps style.
plot -> Stacked Histogram Plots selected data using stacked histogram style.
Plots a Pareto chart of the selected binned data column. The in-
plot -> Pareto Chart - Binned put data typically consists of a text column containing the cate-
Data gories/items and one of numbers containing the corresponding
counts or bins. You must select one or two columns.
plot -> Pareto Chart - Raw Plots a Pareto chart of the selected column containing raw data,
Data typically text: categories, items, etc...
Opens the Bland-Altman Plot dialog that allows to create and
plot -> Bland-Altman Plot... customize a Bland-Altman plot of the selected data columns in
the active table window.
Opens the Q-Q Plot dialog that allows to create and customize a
plot -> Q-Q Plot...
Q-Q plot of the selected data column in the active table window.
plot -> Stem and Leaf Plots selected data using Stem and Leaf style.

Table 4.26: Statistical Plots

Icon Command Key Description


plot -> Vectors XYXY Plots selected data using xyxy vector style.
plot -> Vectors XYAM Plots selected data using xyam vector style.

Table 4.27: Vector Plots


The QtiPlot Handbook 123 / 452

Icon Command Key Description


Plot -> Multi-Curve ->
Plots selected data using two different Y axes.
Double-Y
Plot -> Multi-Curve -> 3Y:
Plots selected data using three different Y axes.
Y-YY
Plot -> Multi-Curve -> 4Y:
Plots selected data using four different Y axes.
YY-YY
Plots selected data in one plot layer along with a magnified re-
Plot -> Multi-Curve -> Zoom gion of that data in another plot layer on the same graph win-
dow.
Creates a new graph window containing a Stacked Lines plot
Plot -> Multi-Curve -> Stack generated from data in the selected columns. Each column is
Lines by Y Offsets drawn as a separate curve which has a vertical offset from the
previous one.
Plot -> Multi-Curve ->
Creates a Waterfall plot from a series of selected columns.
Waterfall
Creates a new graph window displaying each selected data set
Plot -> Multi-Curve ->
as a line curve and a color scale legend that maps the colors of
Colormapped Lines
the curves to the column indices.
plot -> Vertical 2 Layers Plot 2 vertically arranged layers on the same graph window.
plot -> Horizontal 2 Layers Plot 2 horizontally arranged layers on the same graph window.
plot -> 4 Layers Plot 4 layers on the same graph window.
Plot a stacked layer for each selected column, all on the same
plot -> Stacked Layers
graph window.
plot -> Custom Layout... Opens the Arrange Layers dialog to set up custom layouts.

Table 4.28: Special Line/Symbol Plots

Icon Command Key Description


plot -> Bars Plots selected data using 3D bars style.
plot -> Ribbons Plots selected data using 3D ribbons style.
plot -> Scatter Plots selected data using 3D scatter style.
plot -> Trajectory Plots selected data using trajectory style.

Table 4.29: 3D Plots


The QtiPlot Handbook 124 / 452

Figure 4.6: The QtiPlot Column Toolbar

4.7 The Plot 3D Toolbar

Figure 4.7: The QtiPlot Plot 3D Toolbar


The QtiPlot Handbook 125 / 452

Icon Command Key Description


Table -> Add Column Alt-C Adds a new column to the selected table.
Duplicates the selected columns in the table. The new columns
Table -> Duplicate Columns Ctrl-D are appended to the table and have the same properties and val-
ues as the source columns, except the name.
Inserts a new column to the left of the selected column(s) in the
Table -> Insert Column active table. This action is enabled only if there is at least one
column selected in the active table.
Inserts a new row above the selected row in the active table.
Table -> Insert Row This operation works only if there is at least one row selected
in the active table.
Table -> Set Column Values... Alt-Q Used for functional assignment of values in selected column.
Table -> Fill Column With -> Fills each row in the selected column with it’s corresponding
Row Numbers row number.
Table -> Fill Column With ->
Fills each row in the selected column with a random value.
Random Numbers
Table -> Fill Column With -> Fills each row in the selected column with a normally dis-
Normal Random Numbers tributed random value.
Analysis -> Sort Column ->
Sorts selected columns separately in ascending order.
Ascending
Analysis -> Sort Column ->
Sorts selected columns separately in descending order.
Descending
Sorts all columns in the selected table into ascending or de-
Analysis -> Sort Table
scending order.
Analysis -> Statistics on
Computes statistical parameters on selected columns.
Columns
Analysis -> Statistics on Rows Computes statistical parameters on the selected rows.
Table -> Set Column As -> X Define the selected column as abscissae for plotting.
Table -> Set Column As -> Y Define the selected column as an ordinate for plotting.
Table -> Set Column As -> Z For 3D plots, Z columns will be used as height values.
Table -> Set Column As -> Y
Define the selected column for use as error bars for Y-values.
error
Table -> Set Column As ->
Define the selected column as containing labels.
label
Table -> Set Column As ->
This command removes any plot role from selected columns.
Disregard
Table -> Alignment -> The texts in the selected columns are aligned with the left edge
Alignment -> Left of the columns.
Table -> Alignment -> The texts in the selected columns are centered horizontally in
Alignment -> Center the available space.
Table -> Alignment -> The texts in the selected columns are aligned with the right edge
Alignment -> Right of the columns.
Table -> Adjust Column Width Sets an optimal width on the selected columns.
Increases the number of digits displayed in the selected
Table -> Increase Precision
columns.
Decreases the number of digits displayed in the selected
Table -> Decrease Precision
columns.
Table -> Move to First Moves the selected column to the beginning of the table.
Table -> Move Left Moves the selected column to the left.
Table -> Move Right Moves the selected column to the right.
Table -> Move to Last Moves the selected column to the end of the table.
Table -> Swap columns Swap the selected columns.
Table -> Move Row -> UP Moves selected row UP one slot in table.
Table -> Move Row -> DOWN Moves selected row DOWN one slot in table.

Table 4.30: Column toolbar commands.


The QtiPlot Handbook 126 / 452

Icon Command Key Description


plot -> Frame Draw only the three axes.
plot -> Box Draw the three axes and the 3D box around the plot.
plot -> No axes Doesn’t draw the axes nor the box.
plot -> Front Grid Draw a grid on the front panel.
plot -> Back Grid Draw a grid on the back panel.
plot -> Left Grid Draw a grid on the left panel.
plot -> Right Grid Draw a grid on the right panel.
plot -> Ceiling Grid Draw a grid on the top panel.
plot -> Floor Grid Draw a grid on the bottom panel.
plot -> Enable perspective Enables/Disables the 3D perspective mode.
plot -> Reset rotation Resets the rotation of the 3D plot to the default values.
Finds the best layout of the 3D plot fitting the window size. It
plot -> Fit frame to window
readjusts the length of the axis ticks to a default value.
plot -> Bars Style Changes the styles of the bars.
plot -> Dots Draw the 3D scatter points with the dot style.
plot -> Cones Draw the 3D scatter points with the cone style.
plot -> Cross Hairs Draw the 3D scatter points with the cross-hairs style.
plot -> 3D Wire Frame Draw a surface with the wireframe style.
plot -> 3D Hidden Lines Draw a surface with the mesh style (with hidden lines).
plot -> 3D Polygons Draw a surface with the polygons style.
plot -> 3D Wire Surface Draw a surface with the mesh+polygons style.
plot -> Floor Data Projection Draw a projection of the plot on the floor.
plot -> Floor Isolines Draw an isolines projection on the floor.
plot -> Empty Floor Draw an empty floor.
plot -> Animation Enables/Disables animation.

Table 4.31: 3D Plot toolbar commands.


The QtiPlot Handbook 127 / 452

Chapter 5

The Dialogs

5.1 Folder Properties Dialog

This dialog can be opened using the Properties... command from the Windows -> Folders menu or by right-clicking on the name
of a project folder in the Project Explorer and selecting the Properties... action from its context menu.

Figure 5.1: The folder properties dialog box.

With this dialog it is possible to change the default Name of a project folder and to set some Comments for it. The dialog
also displays basic information about the folder: the creation date and time, its Size, its Contents (the number of windows and
subfolders) and its internal Path within the project. If the folder is the root project folder, the dialog also displays the date and
time of the last modification.
The arrow buttons at the bottom of the dialog may be used in order to navigate backward or forward through the whole project
tree. The Window... button opens the Window Properties dialog, making possible to get information about the active window in
the folder.

5.2 Window Properties Dialog

This dialog can be opened using the Rename Window command from the Windows menu or by right-clicking on the title bar of
a project window and selecting the Properties... action from its context menu.
The QtiPlot Handbook 128 / 452

Figure 5.2: The Rename Window dialog box.

With this dialog it is possible to change the default Name and Label of a project window as well as its Window Title display
policy: Name, Label or Both Name and Label. It also makes possible to set some Comments for the project window.
The dialog also displays basic information about the project window: the creation date and time, its Status and its internal Path
within the project.
The Changelog... button is available only for tables and matrices if the option Enable window changelog is checked in the
Application tab of the preferences dialog. By pressing it a new dialog window pops-up. It displays information about the
changes performed on the window. For each modification the date/time and the name of the user having performed it is also
displayed.
The arrow buttons at the bottom of the dialog may be used in order to navigate backward or forward through all the windows of
the current project folder. The Folder... button opens the Folder Properties dialog, making possible to get information about the
parent folder.

5.3 Add Custom Action

This dialog helps you define new Python script launchers that will be added to menus or tool bars in QtiPlot. You can fully
customize script launchers by defining: 1) a textual description that will be displayed in the destination menu, (2) an icon, (3) a
shortcut key sequence and (4) a tool tip. The Tool Tip Text is a short description that is displayed near the launcher button when
you hover the mouse over it. You must assign unique shortcut key sequences to your custom launchers.

Figure 5.3: The Add Custom Script Action... dialog box.


The QtiPlot Handbook 129 / 452

The Script File is the path to the Python script that will be executed when you click the launcher. When you click the Add button,
all the settings for the new launcher are saved to an XML file in the directory specified in the Folder box. On start-up QtiPlot
parses all XML files in this folder and creates the corresponding menu items or toolbar buttons.
When you press the Remove button, the launcher selected in the left side list of the dialog is removed from QtiPlot menus/tool
bars and the corresponding XML file is deleted from the hard disk. Make sure that you have backed up the file if you will ever
need it in the future!

5.4 Custom Color Map

This dialog helps you define a custom color map and quickly edit its settings. It can be activated by selecting the Custom
command from the Matrix -> Palette menu if you are working with a matrix window or by pressing the button from the
Symbol tab of the plot details dialog if you are editing a 2D plot curve.
The dialog displays a table with a set of levels and the color corresponding to each level. You can then add, remove or modify
levels from the definition of the colormap. It is also possible to save/load a custom color map to/from a XML file.
As long as the Scale Colors checkbox remains checked, values that fall between the colormap levels will be displayed in colors
that are interpolated between the colors defined for the bounding levels. It is also possible to define discrete colors for each level.
To do this you must uncheck the Scale Colors checkbox. In this case no interpolation will be done and you must define enough
levels in your colormap to produce a desirable result.

Figure 5.4: The Custom Color Map dialog box.

A click on the Level column header opens the Set Equidistant Levels dialog, which allows to quickly edit the color map levels by
specifying their total number and an intensity range.
A click on the Color column header opens the Gradient Fill dialog, which allows to quickly customize the colors in the map.

5.5 Set Equidistant Levels

This dialog allows to quickly edit the levels of intensity in a color map by specifying their total number and an intensity range
from Minimum to Maximum.
The QtiPlot Handbook 130 / 452

Figure 5.5: Set Equidistant Levels dialog box.

When pressing the Find Min/Max button QtiPlot detects the value range of the dataset (3D curve or matrix) described by the
color map being edited and automatically fills those values in the Minimum and Maximum input boxes.

5.6 Gradient Fill

This dialog allows to quickly customize the colors in a color map using one of the following color definition modes: One Color,
Two Colors, Three Colors, Custom Color Map, Palette or Colormap files.

Figure 5.6: The One Color mode of the Gradient Fill dialog box.

In the One Color mode all color levels in the map have the same color.

Figure 5.7: The Two Colors mode of the Gradient Fill dialog box.

In the Two Colors mode the levels are defined using a linear interpolation between the colors defined with the From and To
buttons.
The QtiPlot Handbook 131 / 452

Figure 5.8: The Three Colors mode of the Gradient Fill dialog box.

In the Three Colors mode this dialog displays a Middle color button, together with a percentage input box, allowing to choose
the position of the third color in the colormap.

Figure 5.9: The Custom Color Map mode of the Gradient Fill dialog box.

In the Custom Color Map mode this dialog displays the From and To color buttons, together with other five intermediate colors.
These seven colors are used to create a linear color gradient.
It is possible to select a color map from a predefined list of palettes if the current mode is set to Palette.

Figure 5.10: The Palette mode of the Gradient Fill dialog box.

In the Colormap files mode, it is possible to select a color map stored in a .map file. The format of a .map file is very simple: it is
a text file in which each line defines a color using the RGB color model. The red, green and blue components of a color must be
integers between 0 and 255. Numbers should be separated by spaces. A colection of .map files can be downloaded by pressing
the Download push button.
The QtiPlot Handbook 132 / 452

Figure 5.11: The Colormap files mode of the Gradient Fill dialog box.

5.7 Add Error bars

This dialog is activated by selecting the Add Error Bars... command from the Graph menu.
This command is used to plot X and/or Y error bars at each data point.
Note that clicking on the "Close" button will not add any error bars to the plot. You must set up the parameters for the error bars
first and then click on the "Add" button. If you click on "Close" without clicking "Add", there will be no error bars drawn.
There are five ways to specify the sizes of the bars:

1) From a column of the table:

In this case, the values in the selected column are used to compute the error bars. Specifically, if V is the value of a data
point, and E the value from the same row of the errorbar column, the size of the corresponding bar will be V-E to V+E.
2) A percentage of the values:

This command adds a new column to the table associated with the plot and fills it with result of calculating V*E/100 for
each row in the table, where V is the plotted value and E is the selected percentage. This column is then used to plot the
error bars in exactly the same manner as in the previous case. The new column can subsequently be edited like any other
column. Any changes will be reflected in the size of the corresponding error bars.
3) The standard deviation of the values: This command first calculates the standard deviation of the plotted values. This has
meaning only if the data are centered around an average value. As with the previous option, a new column will be created
in the active table and each row will be filled with the computed standard deviation. The program does not know and
cannot compute individual standard deviations at each point. If this is required, you will need to independently compute
these values from multiple samples taken at each x or y value.
4) The standard error of the values:
The QtiPlot Handbook 133 / 452

This command first calculates the standard error of the plotted data values. A new column will be created in the active
table and each row will be filled with the computed standard error.
5) The square root of the values: This command first calculates the square root of the plotted data values. A new column will
be created in the active table and each row will be filled with the computed square root.

The default style of the error bars (color, line width, cap length, etc...) can be customized via the Error Bars tab of the Preferences
dialog.
If you need to display asymmetric error bars you must define two sets of error bars for the same curve: one for the upper limits
(with disabled minus side) and one for the lower limits (with disabled plus side).

Figure 5.12: Example of a plot with both X and Y Error Bars.

5.8 Function Dialog

This dialog box is used to add a function curve to the active plot or to edit an already existing function curve. In the latter case it
is embedded into the Plot details dialog
The plotted function is built with the common operators *, +, /, -, and ˆ (for multiplication, addition, division, subtraction and
exponentiation, respectively). A complete set of intrinsic functions are available and these are listed in the muParser section of
the chapter on Mathematical Expressions and Scripting.
The first item is the Curve type and is used to select the form of the generator function. The simplest and most common function
definition is the classical cartesian coordinate definition, y=f(x). This is the default option and is simply named Function.
The QtiPlot Handbook 134 / 452

Figure 5.13: The Add Function... dialog box: Cartesian Coordinates.

The Comment input box can be used to enter a text that will be displayed in the plot legend instead of the default function name.
Just below, there is a text pane provided for entering the function definition.
On the left side of this text pane there are three buttons. By pressing the first one, displaying the capital greek letter sigma Σ, a
menu pops-up listing all built-in mathematical functions provided by QtiPlot. Pressing one of the actions from this menu copies
the displayed function into the edit box at the position of the text cursor.
Clicking on the button displaying a pencil icon opens a menu which lists recently used functions. By pressing one of the menu
items, the selected function is inserted into the edit text box at the current position of the cursor.

Clicking the Clear button removes the contents of the function definition text box.
The next two parameters are used to select the X-range to be used for the plot. The third parameter sets the number of data points
to be computed in the selected X-range.
If the function expression contains terms that are recognizable as constants, e.g.: f(x) = a*x + b, QtiPlot detects them and displays
a two column table on the right side of the dialog which contains input spin boxes that simplify the process of setting appropriate
values for the detected constants.

Figure 5.14: The Add Function... Dialog Box: Automatic Detection of Constants.
The QtiPlot Handbook 135 / 452

A function can also be defined using a parametric definition by selecting Parametric plot as the Curve type. That is, given some
variable, m, the (x,y) data points are computed using functions of that variable, x=f(m) and y=g(m).
The first parameter is the name of the parametric variable (here m). It is followed by the definitions of the two functions, the
range of the parametric variable, and the number of data points.

Figure 5.15: The Add Function... dialog box: Parametric Coordinates.

Finally, a polar definition of the function may be used by selecting Polar plot as the Curve type. Given some variable t, then the
radius (R) and angle (Theta) are computed using two functions of that variable, R=f(t) and Theta=g(t), in a manner similar to the
parametric function case. The (x,y) data points are then computed as x=R*cos(Theta) and y=R*sin(Theta).
The first parameter is the name of the parametric variable (here t). It is followed by the definition of the two functions, the range
of the parametric variable, and the number of data points. Note that the angle is in radians. pi is an internally defined constant
which can be used in any mathematical expression. For example, you can use 3*pi to define the parameter range.

Figure 5.16: The Add Function... dialog box: Polar Coordinates.


The QtiPlot Handbook 136 / 452

5.9 Function 2D Dialog

This dialog box is used to create a new contour/image plot window (New Function 2D... command) or to add a function of two
variables (x and y) to the active plot layer (Add Function 2D... command). It is also used for editing an already existing 2D
function. In the latter case it is embedded into the Plot details dialog.

Figure 5.17: The Function 2D dialog box.

Using this dialog it is possible to create 2D plots from analytical functions of two variables without having to create a matrix
window first. If launched as a stand-alone dialog the user may choose the type of plot to be created between the following
options: Contour - Color Fill, Contour Lines - Color Mapped, Contour Lines, Gray Scale Map and Heat Map
The mathematical expression can be built with the common operators *, +, /, -, and ˆ (for multiplication, addition, division,
subtraction and exponentiation, respectively). A complete set of intrinsic functions are available and these are listed in the
muParser section of the chapter on Mathematical Expressions and Scripting.
If a text is typed in the Comment input box, it will be used as the title of the 2D image/contour plot item.

5.10 Add Layer

This dialog is opened when you add a new layer on the active plot. If you select Guess, QtiPlot will divide the window in two
columns and put the new layer on the right. If you choose Top-Left Corner, QtiPlot will create a new layer with the maximum
possible size and locate it on top of existing layers. The new layer contains an empty plotting area. You can subsequently modify
the size and position of each layer by selecting it with the layer number buttons and picking the Layer Geometry command
from the context menu.

Figure 5.18: The Add Layer Dialog Box.

5.11 Add/Remove Curves

This dialog is activated by selecting the command Add/Remove Curves... from the Graph Menu.
The QtiPlot Handbook 137 / 452

The left window shows the columns available from the project’s tables that may be used for plotting. If the Show current folder
only option is checked, only tables from the active folder of the project will be listed in this window. It is possible to sort the
available tables/folders in alphabetical order by pressing the Available data column header. The right window lists the curves
already plotted. In the case presented below, there are two tables that the Add/Remove Curves... dialog box lists for the selection
of columns. You select a Y column to plot using this dialog. QtiPlot will use the column defined as X in the corresponding table
for the X values.

Figure 5.19: The Add/Remove Curves... Dialog Box.

The data sets selected in the Available data window can be added to the plot either by pressing the left to right arrow button
or by dragging and dropping them onto the Graph contents window. Similarly, the selected plot items from the Graph contents
window can be removed either by pressing the right to left arrow button or by dragging and dropping them onto the Available
data window.
In this dialog box, if you select one curve of the plot in the right window, you can change the columns used for X and Y with the
Plot Association button. In any case, you can’t mix the X values from one table with the Y values from another one. If you want
to do this, you have to copy the columns into the same table.
If the curve selected is a function, you can modify it by pressing the Edit Function... button. Refer to the Add Function... dialog
box for more details on functions editing.
If the Show Range option is checked, the plot range of all the curves not defined as analytical functions will be also displayed
in the right window of the dialog. The plot range is the interval of points which are visible in a curve. You can show/hide data
points from a selected curve, without having to delete them, by pressing the Edit Range... button, which opens a dialog allowing
to edit the plot range.
If the case of 3D plots this dialog looks a little bit different: the Axes list boxes as well as the Plot Association and Show Range
buttons described above are not available.
The QtiPlot Handbook 138 / 452

Figure 5.20: The Add/Remove Curves... dialog box for 3D plot windows.

5.12 Arrange Layers

This dialog is activated by selecting the Arrange Layers... command from the Graph Menuor by entering Shift-A.
This dialog provides for modification of the geometrical arrangement of plot layers which are already present in the active graph
window. You can add new layers or remove existing ones using the Number of layers control. Checking the Link X axes option
makes all the X-axes interdependent, meaning that if you manually set abscissa scale limits on one plot layer, then the same
limits will automatically be set on all other layers in the plot window.
You can specify the number of rows and columns that define a grid of plots. With the default settings, QtiPlot computes the size
of the layers in the grid from the size of the graph window. If you check the Layer Canvas Size option, you can set the size of the
drawing area for the layers. QtiPlot will then modify the size of the graph window to accommodate them. When the Fixed size
box is checked, the size of the layers will be kept unchanged when you manually resize the graph window.
The controls in the two group boxes on the right, Alignment and Spacing, are used to set the alignment of the layers in the window
and the margins between the layer borders and the graph window limits. The Spacing group includes an Align control with 2
options (Canvases and Layers) that control the meaning of the row and column spacing entries. If the Canvases alignment option
is chosen, then the spacing fields define the distances between the axes of the layers. On the other hand, if the Layers alignment
option is chosen, then the spacing fields define the distances between the borders of the layers.
Finally, it is also possible swap two layers using the Swap Layers controls. Simply select the Source and Destination layers and
click the Swap button.
The QtiPlot Handbook 139 / 452

Figure 5.21: The Arrange Layers... dialog: the Geometry Tab

Once suitable choices have been made, clicking on either the Apply or OK buttons will arrange the layers to obtain the desired
alignment of the vertical and horizontal axis.
The QtiPlot Handbook 140 / 452

Figure 5.22: Example of a vertical arrangement for two plots.

Note that if modifications are later made to an aligned plots, then alignment of the different axes may be lost. Simply re-execute
Arrange Layers... to again re-arrange the plot.

5.13 Graph Manipulation

This dialog is activated by selecting the Extract to Graphs... command or the Merge Graph Windows... command from the Graph
Menu.
If opened with the Extract to Graphs... command, each layer in the currently active graph window is copied into its own, newly
created, graph window, having the same size as the source graph window. This dialog allows you to decide what happens with
the original graph window. If you uncheck the Keep Source Graph option, then the original window is deleted. If the option Full
Page for Extracted Layers is checked, the new layers will be resized to fill their whole graph windows.

Figure 5.23: The Graph Manipulation dialog used for extracting individual layers from 2D graph windows.
The QtiPlot Handbook 141 / 452

If opened with the Merge Graph Windows... command, this dialog displays a list of 2D graph windows. You may choose to
display in this list only the graphs from the curently active folder or from the whole project. The list can be sorted alphabetically
in ascending or descending order by clicking on the Graph column header. All these graph windows will be merged into a newly
created 2D plot window. You may also choose the graph windows to be merged by selecting the option Specified in the Merge
list box. Also, you may decide what happens to the original graph windows after the merging process. If you uncheck the Keep
Source Graph option then the source windows are deleted.

Figure 5.24: The Graph Manipulation dialog used for merging 2D graph windows.

If the OK button is pressed, QtiPlot creates a new graph window and closes this dialog. The Arrange layers dialog pops-up,
allowing users to specify the layout of the newly created graph window.

5.14 Line Options

This dialog allows modification of lines or arrows which have been created with either the Draw Arrow (Ctrl-Alt-A) or Draw
Line (Ctrl-Alt-L) commands from the Graph Menu. The dialog can also be opened by double clicking on an arrow or line, or by
right clicking a selected arrow or line and then selecting Properties... from the resulting pop-up menu. It can also be embedded
into the Plot details dialog when you select a line/arrow from the list of objects in a 2D plot layer.

5.14.1 Line Tab

The Line tab of the dialog allows changing the color, the style of the line and the line width. Line width is set in pixels. The
changes you make can be applied to the selected line, to all lines in the plot layer, to all lines in the active window or to all line
objects from all plot windows, depending on the selection in the Apply to... box.
It is also possible to define a default style for all new lines by clicking the Set Default button.
The QtiPlot Handbook 142 / 452

Figure 5.25: The Arrow Options Dialog: Line Tab

5.14.2 Arrow Head Tab

The Arrow Head tab is used to modify the shapes of the arrow heads. Length is expressed in pixels and the angle in degrees. The
changes can be applied to the selected line, to all lines in the plot layer, to all lines in the active window or to all line objects from
all plot windows, depending on the selection in the Apply to... box.
It is also possible to define a default style for the arrow heads using the Set Default button.

Figure 5.26: The Arrow Options Dialog: Arrow Head Tab

5.14.3 Geometry Tab

The Geometry tab is used to specify the starting and ending points of the selected line/arrow. The coordinates can be set as a
function of the scale values displayed on the left (Y) and bottom (X) axes, or in pixels, by choosing the desired method from the
Unit pull-down list. Pixel coordinates are relative to the top-left corner of the layer which contains the line.
The Alignment list box can be used in order to link the X or Y coordinates for the start and end points. It provides the following
options: None, Horizontal and Vertical. If set to Horizontal, the Y coordinates are linked else, if set to Vertical, the X coordinates
are linked, meaning that after changing the coordinate of the start point, the same value will be automatically set to the end point
and vice versa. QtiPlot marks the connection between the coordinates by displaying a chain icon close to the Y or X input boxes,
respectively.
The QtiPlot Handbook 143 / 452

Figure 5.27: The Arrow Options Dialog: Geometry Tab

5.14.4 Axes Tab

The Axes tab is used to specify the axes to which the selected line/arrow is attached. The changes can be applied to the selected
line, to all lines in the plot layer, to all lines in the active window or to all line objects from all plot windows, depending on the
selection in the Apply to... box.

Figure 5.28: The Arrow Options Dialog: Axes Tab

5.15 Reference Line Options

This dialog allows the modification of reference lines that have been created with the Add Reference Line... command from the
Graph Menu. The dialog can be opened by double clicking on a reference line or by right clicking a selected reference line and
then choosing Properties... from the resulting pop-up menu. It can also be embedded into the Plot details dialog when you select
a reference line from the list of objects in a 2D plot layer.
A reference line has a non-empty name that can be used to identify it in the plot details dialog or in Python scrips. The default
generated names are: line1, line2, etc...
By default, a reference line is Selectable, meaning that it can be selected with the mouse and also Movable, meaning that it can be
dragged while pressing the left button of the mouse. Reference lines, like any other object of a 2D plot layer, can be unselected
by pressing the ESC key.
The drawing of the line can be disabled by unchecking the Line box. This doesn’t affect the drawing of the filling brush.
The area between a reference line and a baseline Value can be filled with a colored brush if the Fill to group box is checked.
The transparency of the filling brush can be controlled using the Opacity slider. If the Line radio button from this group box is
The QtiPlot Handbook 144 / 452

checked, it is possible to choose an existing reference line in order to serve as baseline. Of course, the two reference lines should
have the same orientation (Horizontal or Vertical).
Depending on the way in which the position of the line is defined, there are two types of reference lines available in QtiPlot:
Value-based and Statistics-based lines.

Figure 5.29: The reference Line Options dialog for Value-based lines.

The Statistics-based lines are attached to an existing plot curve and can be displayed at any of the predefined statistical values
from the list bellow. They are not Movable, by default.

Mean Mean value of the curve data points.

Median Median value of the curve data points.


Mean + Standard Deviation Mean value plus the standard deviation of the curve data points.
Mean - Standard Deviation Mean value minus the standard deviation of the curve data points.
Mean + Standard Error Mean value plus the standard error of the curve data points.

Mean - Standard Error Mean value minus the standard error of the curve data points.
Mean + 95% Confidence Interval The upper limit of the 95% confidence interval for the mean of the curve data points.
Mean - 95% Confidence Interval The lower limit of the 95% confidence interval for the mean of the curve data points.

Minimum Minimum value of the curve data points.


Maximum Maximum value of the curve data points.

The 95% confidence interval for the mean is calculated as Mean ± t0.975,n-1 SD/n1/2 , where n is the size of the data set (the number
of data points of the plot curve), SD is the standard deviation and t0.975,n-1 is the Student’s t distribution with n - 1 degrees of
freedom.
The QtiPlot Handbook 145 / 452

Figure 5.30: The reference Line Options dialog for Statistics-based lines.

A reference line can be attached to an existing legend that can be selected from the Attach to list when the Label group box is
checked. If there are no legends available in the plot layer you can create one by pressing the ’+’ button. The button displays
the text New Legend when hovered with the mouse. The text of the newly created legend is set to $(v, *6), which is the default
syntax for displaying the position of the reference line with six figures precision.
The attached legend may be edited by pressing the ’...’ button (displaying the text Edit when hovered with the mouse). This
opens the properties dialog of the selected legend. When the properties dialog of the legend is closed, QtiPlot returns to the
properties dialog of the reference line (this dialog).
Only one coordinate of the position of the attached legend is controlled by QtiPlot. From the Alignment list you may choose the
anchor point of the legend: Top, Center or Bottom if the reference line is horizontal and Left, Center or Right if the reference line
is vertical. The other coordinate of the anchor point of the legend may be freely chosen, for example by moving the legend with
the mouse.

5.16 Image Options

This dialog allows modification of images which have been created with the Add Image (Alt-I) command from the Graph Menu.
The dialog can be opened by double clicking on an image or by right clicking a selected image and then choosing Properties...
from the resulting pop-up menu. It can also be embedded into the Plot details dialog when you select an image from the list of
objects in a 2D plot layer.

5.16.1 Image Tab

This tab allows changing the file that is displayed by the image object. The file path can be edited manually or can be selected
from a file dialog that pops-up when pressing the browsing push button on the right side of the File edit box.
The QtiPlot Handbook 146 / 452

Figure 5.31: The Image Options Dialog: Image Tab

The image data is saved inside the QtiPlot project if the option Save internally is enabled. Otherwise, only a link to the external
image file is saved, which is not portable and should be avoided if you intend to send the project file to someone else.
If the Interpolation option is enabled, the image displayed on screen is rendered using bilinear filtering when the image object
is resized. As a result the displayed image is much smoother, but this comes with a price: the rendering speed can become low,
especially for large images. The Interpolation option is not available if the image was created from a file having an EMF or SVG
vectorial format.

5.16.2 Frame Tab

This tab is used to define the shape, color, line style and thickness for the frame of an image object. By default, an image has no
frame at all, the Shape being set to None.
The QtiPlot Handbook 147 / 452

Figure 5.32: The Image Options Dialog: Frame Tab

The changes can be applied to the selected image, to all images in the plot layer, to all images in the active window or to all
image objects from all plot windows, depending on the selection in the Apply to... box.
It is also possible to define the current frame options as a default style for the frame of all future images by pressing the Set As
Default button.

5.16.3 Geometry Tab

The Geometry tab is used to specify the size and the position of the selected image. The coordinates can be set as a function
of the scale values displayed on the left (Y) and bottom (X) axes, or in pixels, by choosing the desired method from the Unit
pull-down list. Pixel coordinates are relative to the top-left corner of the layer which contains the image.
The QtiPlot Handbook 148 / 452

Figure 5.33: The Image Options Dialog: Geometry Tab

5.17 Column Options

This dialog is activated by selecting the Column Options... command from the Table Menu. At least one column must be selected
before this command can be used.
The QtiPlot Handbook 149 / 452

Figure 5.34: The Column Options... Dialog.

The checkbox Enumerate all to the right is used to rename of all the columns which lie to the right of the selected column. For
example, if the name of the selected column is "xyz", then the selected column and all of the following columns will be renamed
to "xyz1", "xyz2", and so on.
The "<<" and ">>" buttons change the selected column. The highlighting of the column in the table behind the dialog box will
change indicating that a new column has been selected. The column to which the formatting commands are applied is the one
whose name appears in the "Column Name" box.
The Plot Designation selector is used to define which columns are to be used as X, Y or Z values or as error bars. In a table you
can select several columns as X, in which case the column labels will display as [X1], [X2], etc. Multiple Y columns will display
as [Y1], [Y2], etc. The same scheme is followed for multiple Z columns.
The Alignment selection box is used to define the position of the text in the selected column: it can be aligned with the left or
right edge of the column or centered horizontally in the available space.
The Comment box allows entering text that will be displayed in the table header just below the column name when the Display
Comments in Header option is checked.

5.18 Plot Associations

This dialog is activated by selecting the Plot Associations... command from the Format Menu. It may also be activated by
right-clicking on a plot curve and selecting Plot Associations.... This dialog is only available if the active plot layer contains data
curves.
The QtiPlot Handbook 150 / 452

Figure 5.35: The Plot Associations Dialog.

This dialog may be used to select the columns of the table to be used as X, Y and error values for the active curve.
The name of the active 2D plot window is displayed in the Graph label, while the name of the table containing the data sets for
the active curve is displayed in the Table label. It is possible to change the plot layer containing the data curve which this dialog
modifies using the Layer spin box.

5.19 Edit Curve Range

This dialog is activated by selecting the Edit Range... command from the Format Menu. It may also be activated by right-clicking
on a plot curve and selecting Edit Range.... This dialog can be opened only if there is a selected data curve in the active plot layer.

Figure 5.36: The Edit Curve Range Dialog.

This dialog may be used in order to change the visible data range for a 2D plot curve. By default, the Auto boxes are checked
and QtiPlot displays the start row number (1) and the end row number corresponding to the full data range of the curve. In order
to edit these values the Auto boxes must be unchecked first.

5.20 Plot Details

This dialog is activated by selecting the Plot... command from the Format Menu. It may also be activated either by a double click
on a plot or by right-clicking on a plot and selecting Plot Details.... If there is more than one layer in the window, QtiPlot will
select the layer which contains the plot under the mouse pointer. The exact contents of the dialog will vary depending upon how
the dialog was invoked and on the type of plot item selected.
The left part of the dialog window is a tree view that shows the plot layers in the active window and the curves and objects which
are plotted on each layer. All modifications will be made to the selected item (window, layer, curve or plot object). The right part
of the dialog box contains several tabs which depend on the kind of item selected in tree view on the the left side of the dialog.
They are described in the following subsections.
If the selected item is a plot curve than the Table, Plot Associations... and Edit Range... buttons become visible. Clicking the Plot
Associations... button opens a dialog which can be used to select the columns of the table to be used as X and Y values for the
active curve. Clicking the Edit Range... button opens a dialog which can be used to change the visible data range for the active
curve. If the Table button is visible, it may be used to access to the table which contains the columns for the selected curve.
The QtiPlot Handbook 151 / 452

5.20.1 Dimensions

In the Dimensions tab you can accurately set the position and size of the graph window. The size can be applied to either the
selected window or to all graph windows in the project. When the Keep aspect ratio option is checked, changing either the
width or height will proportionally change the other dimension. It doesn’t mean that the aspect of the graph window will remain
unchanged when you manually resize it with the mouse. If you want to enable this fixed aspect behaviour for the graph layers,
you need to visit the layer geometry tab. You should use the preferences dialog if you want to change the default behaviour for
all plot layers that will be created in the future.
If the option Do not resize layers when window size changes is checked the size and position of the plot layers will remain fixed
when the user changes the dimensions of the window.

Figure 5.37: The Plot Details Dialog: Dimensions tab.

5.20.2 Print

A graph page with dimensions that are smaller or larger than those of the printable area will be printed scaled to the dimensions
of the printer page if the Scale layers to paper size option is checked.
Select the Print Cropmarks check box to display crop marks at the margins of the printer’s printable area.
The QtiPlot Handbook 152 / 452

Figure 5.38: The Plot Details Dialog: Print tab.

5.20.3 Fonts

Using the controls in the Fonts tab you can customize with just a few clicks the fonts for various elements of all plot layers in the
graph window.

Figure 5.39: The Plot Details Dialog: Fonts tab.

5.20.4 Miscellaneous

By checking the Link X axes option in the Miscellaneous tab, the layers in the graph window will be linked: when changing the
X axis scale in one layer the X scales in the other layers will be adjusted accordingly. This behavior can be applied to the active
window or to all graph windows in the project.
The QtiPlot Handbook 153 / 452

Figure 5.40: The Plot Details Dialog: Miscellaneous tab.

5.20.5 Window Display

In the window Display tab you can define the style for the background of the graph window page. By default it is filled with a
solid white color, but you can set it to be filled with a color gradient. By pressing the Set As Default button these settings will be
automatically applied to all graph windows created in the future.

Figure 5.41: The Plot Details Dialog: Display tab.

5.20.6 Legends/Titles

The Legends/Titles tab provides controls for automatic legend and title construction in QtiPlot graphs.
You can use the Translation Mode %(1), %(2) drop-down list in the Legends group box to specify the table column header
information that should be used in the graph legend. The second Translation Mode drop-down list in the Auto Axis Titles box has
the same utility with respect to the graph axis titles.
The QtiPlot Handbook 154 / 452

If the Auto-update box is checked, plot legends are updated each time a curve is added or removed from the plot layer the legends
belong to. By pressing the Set As Default button these settings are saved to the user preferences and reused each time you create
a new 2D plot window.

Figure 5.42: The Plot Details Dialog: Legends/Titles tab.

The Data Plot Index control is useful when plotting multiple Y columns of data against a single X column. You can use it in
order to specify which data column will provide the information for the axis titles. You should be aware that when choosing the
data column based on this index QtiPlot takes into account the number of curves attached to each layer axis.
If the option Show Units (when available) is selected the contents of the table column’s Unit property will be appended to the
axis title. All these settings can be applied to the active graph or to all 2D plot windows in the project, depending on the option
you choose in the Apply to... list box on the right side of this dialog tab.
The following tabs are available when an item corresponding to a plot layer is selected in tree view on the the left side of the
dialog:

5.20.7 Layer

In the Layer tab you can define the style properties of the plot layer: the background color/gradient and the frame around it. You
can also customize the behavior of the plot layer: enable/disable Antialiasing for the drawing of data curves, Autoscaling of the
axes range when the data curves are modified and automatic resizing of the fonts when the size of the plot layer is changed by
the user (Scale Fonts check box).
The Synchronize scales box is checked by default, meaning that the scale range and the tick divisions of the opposite layer
axes (left/right and bottom/top) are automatically forced to have the same values when you modify any of them. If you need to
represent different data ranges for each axis you should uncheck this box. This option can also be automatically customized for
all newly created 2D plot layers using the Synchronize scale divisions box from the Axes tab of the Preferences dialog.
The QtiPlot Handbook 155 / 452

Figure 5.43: The Plot Details Dialog: Layer properties.

5.20.8 Canvas

In the Canvas tab you can define the properties of the plot canvas: the background color/image and the frame around the canvas.

Figure 5.44: The Plot Details Dialog: Canvas with a solid background color.
The QtiPlot Handbook 156 / 452

Figure 5.45: The Plot Details Dialog: Canvas with a background image.

5.20.9 Geometry

The third tab defines the geometry of the drawing canvas in a plot layer. When the Keep aspect ratio option is checked, changing
either the width or height will proportionally change the other dimension. Also, the ratio between the width and the height of the
plot canvas will remain unchanged when you manually resize the graph window.

Figure 5.46: The Plot Details Dialog: Canvas geometry.

5.20.10 Speed

The Speed tab can be used to customize the speed mode for the layer. This can be very useful when dealing with very large data
sets. Speed mode uses the Douglas and Peucker algorithm, the purpose of which is to take a ’curve’ composed of line segments
(or points) and find a new curve with fewer points that is not too dissimilar from the original curve. The algorithm defines ’not
too dissimilar’ as a function of the maximum distance (tolerance) between the original curve and the new curve. The new curve
then consists of a subset of the line segments (or points) that defined the original curve. When the speed mode is enabled, filtering
of the data is activated only for the curves with more than the specified maximum number of data points.
The QtiPlot Handbook 157 / 452

Figure 5.47: The Plot Details Dialog: Layer Speed Mode.

5.20.11 Layer Display

The layer Display tab can be used to customize the display options for the plot layer.
The Data Drawing Options group box enables fine control over the way data is drawn on the plot canvas. If the Margins box is
checked QtiPlot automatically adds some amount of space before and after the data values along each axis scale. The effect of
this option is mainly visible when creating new plots from table columns or when rescaling a plot layer so that all data on the
graph is visible, using the Graph -> Rescale To Show All command.
Using the controls in the Drop Shadow group box it is possible to enable/disable the display of a drop shadow effect for all curves
in a plot layer. The drawing options for the drop shadows are the color (by default it is set to dark gray), the offset (8 pixels
by default) and the blur radius (5 by default).It is also possible to show/hide the drop shadow of individual plot curves via their
context menu (right-click on a plot curve in order to make it pop-up).
The controls in the Axes group box can be used to enable/disable the display of individual plot axes.

Figure 5.48: The Plot Details Dialog: Layer Display.


The QtiPlot Handbook 158 / 452

5.20.12 Stack

The Stack tab can be used to customize the vertical offset between data curves. The following stacking modes are available:

None: Data plots are not stacked. This is the default mode.
Cumulative: Y values of data plots are stacked cumulatively.
Constant: Data plot points are shifted by a specified constant value that can be set in the edit box to the right of the Constant
radio button.

Auto: QtiPlot calculates constant offsets based on min-max Y value difference and a specified gap. The gap value can be set in
the edit box to the right of the Auto radio button.
Individual: Each plot has individual offset settings, which can be modified on the Offset tab in the plot details dialog when the
corresponding plot curve is selected in the left panel under the expanded Layer icon.

Figure 5.49: The Plot Details Dialog: Layer Display.

5.20.13 Group Edit

The Group Edit tab can be used to customize the appearance of all plot curves with only a few clicks. This is mainly helpful
when you have a lot of data curves and you want to avoid individually editing curve style properties.
The Line Color push button in the Increment Curve Properties box is intended to be used in conjunction with the Indexed Colors
list defined in the Curves tab of the Preferences dialog. By pressing this button, the line colors of all the data curves in the current
plot layer will be changed according to their indices in this list of colors. The other two buttons Line Style and Pattern will change
the line style and the fill patterns respectively. Please beware that by pressing the Pattern button the area bellow the curves will
be automatically filled, even if it wasn’t before.
The QtiPlot Handbook 159 / 452

Figure 5.50: The Plot Details Dialog: Group Edit tab.

The Gradient Fill box adds the possibility to apply a colour map to all plot curves. The default color map can be defined via
the 3D Colors tab of the Preferences dialog. The line color, fill color and symbol color of all the data curves will be changed
to a color in the user defined range. This change can be applied to the current plot layer or to all the layers in the current graph
window as well as to all 2D graph windows.
The same functionality can be accessed via the context menu of a layer (right-click on the layer canvas to make it pop-up). The
image bellow shows the Palette sub-menu that can be used to set a gray scale gradient or the default color map. You can also
apply the Indexed Colors default list defined in the user preferences. The Style sub-menu gives access to the Increment Line Style
and Increment Fill Pattern functions explained above.

Figure 5.51: Context menu of a plot layer.


The QtiPlot Handbook 160 / 452

5.20.14 Curve axes

The Axes tab, the first tab on the right side of the dialog window, allows definition of the pair of axes to which a curve is attached.
Attaching different curves on the layer to different X/Y axis pairs permits placing several curves with different x/y scales on the
same plot layer.

Figure 5.52: The Plot Details Dialog: Assign Axes.

5.20.15 Line/Pattern

The title of this tab may be either Line or Pattern depending on the type of the selected plot curve. This tab allows customizing
the style of the plot line (color, line style, thickness). The connect button allows changing the style which is used to draw the
selected curve (steps, droplines, etc). See the Plot menu to see the different types of plots available.

Figure 5.53: The Plot Details Dialog: Line formatting.


The QtiPlot Handbook 161 / 452

5.20.16 Symbol

The Symbol tab can be used to select the plot symbol used for the data points and to modify its aspect (size, color, fill color,
transparency). There are three categories of plot symbols available in QtiPlot: Standard, Unicode and Image symbols and you
can choose one of them by clicking the corresponding radio button from the top side of this tab. Each category of symbols has
its own customizable properties.
The Size drop-down list box may be used to select either a column that contains the size values for the plot symbols or a constant
value. Alternatively you may type a custom constant size value. Units are measured in pixels. If the size values are taken from a
table column, the Scaling Factor box becomes visible and its value may be used to proportionally increase or decrease the sizes
of the plot symbols.

Figure 5.54: The Plot Details Dialog: Standard Symbol formatting.

If the the shape of the symbol is an ellipse (a circle in fact), the Size based on combo box becomes visible. It lets you choose
how the area of the symbols is determined by the value selected/typed into the Size combo box. Three options are available:.

Square: The area is calculated as the area of the square enclosing the circle: A = Size*Size.
Diameter: The diameter of the circle equals the value defined for Size, the area being calculated as: A = Pi*Size*Size/4.
Area: The area of the circle equals the value defined in the Size box: A = Size.

The color of the Edge, used to draw the shape of the symbol, as well as the Fill Color, may be either an individual RGB color
that you can select from a table by pressing the color button or a color map based on the values stored in a table column. In the
second case QtiPlot creates evenly sized ranges of values between the minimum and maximum values of the column selected
in the combo box and associates a color with each range of values. The color of the symbol is determined by finding the color
associated with the column value into this color map. By pressing the edit button the Custom Color Map dialog pops-up,
allowing to customize the default color map.
The QtiPlot Handbook 162 / 452

Figure 5.55: The Plot Details Dialog: Unicode Symbol formatting.

The Original size button is available only if the symbol is an Image. This button is automatically enabled when the current size
of the plot symbols is different from the original image size. If pressed, the current size settings are reverted to the original image
size.

Figure 5.56: The Plot Details Dialog: Image Symbol formatting.

5.20.17 Labels

The Labels tab is used if you want labels plotted at each data point in the plot. Options are provided to control the font, color,
rotation angle and position of these labels.
If the Custom option is selected in the Label Form list box, the user can enter a string format in the text input box that becomes
The QtiPlot Handbook 163 / 452

visible. The format string may contain the following synthax specifiers: $(x) and $(y), as substitutes for the abscissa and ordinate
values of the curve data points. The display of the numeric values can be customised using the following format specifiers:

*n Display n significant digits: $(y, *3), where y equals 1.1415, displays 1.14.
.n Display n decimal places: $(y, .3), where y equals 1.1415, displays 1.141.
E.n Display n decimal places in engineering format: $(y, E.3), where y equals 0.1415, displays 141.500m.
S.n Display n decimal places in upper case scientific format: $(y, S.3), where y equals 0.1415, displays 1.415E-01.

If no custom format specifiers are found, QtiPlot uses the values provided in the Format/Precision controls as default, in order to
display numeric values in custom labels.
In the case of contour line plots created from matrices, the Label Form list box is not available, the labels being used only to
display a Z value for each of the contour lines.

Figure 5.57: The Plot Details Dialog: Labels formatting.

5.20.18 Offset

The Offset tab is only available when the plot layer has the Individual stacking mode enabled. It may be used to specify custom
offsets for the plot curves in both horizontal and vertical directions. The values defined in the X/Y multipliers input boxes can be
used as horizontal/vertical offsets in case the plot layer has logarithmic scales.
The QtiPlot Handbook 164 / 452

Figure 5.58: The Plot Details Dialog: Offset formatting.

5.20.19 Error bars

With the controls in the Direction group you can specify if the positive and/or negative side of the error bars should be drawn, by
checking the Plus and/or Minus boxes. You can also specify if the error bars are horizontal or vertical by checking/unchecking
the X Error Bar box.
Using the controls in the Style group box you can customize the error bars in terms of color, line width, cap width and trans-
parency. Finally, it is possible to tell QtiPlot to skip a number of data points when drawing the error bars by specifying a positive
value in the Skip Points box.

Figure 5.59: The Plot Details Dialog for formatting error bars.

5.20.20 Pie plots

These commands are available for pie plots. The first tab is used to customize the pie segments. The fields on the left are used to
modify the border drawn around each segment. The color, type and width of line may be customized. The default border color is
white.
The QtiPlot Handbook 165 / 452

The fields on the right are used to define the fill style used for pie segments. The First color combo-box defines which color is
used for the first segment. The remaining segments will be filled with colors that follow the order defined in the combo-box’s
list. The default value for this field is black, so segments 2, 3, ... will be red, green, etc. These default colors can be customised
via the Colors tab. When pressing the Edit.. button, the Colors tab is automatically raised and a color dialog pops-up, allowing
to choose a custom color as the first color.
The Pattern combo-box defines the fill pattern that will be used for all segments of the pie. The default value is solid fill.

Figure 5.60: The Plot Details Dialog for pies: Pie Segment Formatting.

If the value selected in the Apply Format to list box is different than Selected Curve, the settings are applied to all pie or doughnut
curves from the active Layer, from all plot layers in the current Window or from all 2D plot windows in the project, respectively.

5.20.21 Pie geometry

This tab can be used in order to customize the geometry of a pie chart: its Radius, expressed in percentages of the layer width
and its Horizontal Offset, which is the horizontal displacement with respect to the center of the drawing canvas.
The controls in the 3D View group box can be used in order to define a pseudo 3D layout for the pie chart. This can be achieved
by defining a View Angle different from 90 degrees and a Thickness, expressed in percentages of the pie radius.
The value of the Size (% radius) input box from the Doughnut group can be used in order to add a doughnut hole in the pie chart
and to specify its size in percentages of the pie radius. This control is automatically disabled for 3D pie charts, that is for charts
having the value of the View Angle (deg) different from 90 degrees.
The QtiPlot Handbook 166 / 452

Figure 5.61: The Plot Details Dialog for pies: Pie Geometry.

5.20.22 Pie labels

Figure 5.62: The Plot Details Dialog for pies: Pie Labels Formatting.

5.20.23 Colors

The controls in this tab can be used in order to customize the default indexed list of colors used to fill the segments of pie charts.
The indexed color list can be edited using the tool buttons on the right side: the New Color button, the Delete Color button,
the Move Color Up button and the Move Color Down button. It is possible to save a custom indexed color list to a text file
(*.txt), by pressing the Save As... button. The structure of this file is very simple: the colors are saved one per line, using the
RGB format #RRGGBB. The text file can be loaded later on into the color list editor by pressing the Open File... button.
The default indexed color list defined in the preferences dialog can be loaded into the color list editor by pressing the Load
Default button.
The QtiPlot Handbook 167 / 452

Figure 5.63: The Plot Details Dialog for pies: Pie Colors Formatting.

5.20.24 Box

Figure 5.64: The Plot Details Dialog for box and hiskers formatting.

5.20.25 Percentile

The controls available in this tab allow to easily enable/disable the display of the symbols for the different percentiles and to
modify their settings. If the value activated in the selection box Apply Format to is different than Selected Curve, all settings,
except colors, are applied to all box curves from the active Layer, from all plot layers in the current Window or from all 2D plot
windows, respectively.
The QtiPlot Handbook 168 / 452

Figure 5.65: The Plot Details Dialog for box: Percentile Formatting.

5.20.26 Outliers

The controls available in this tab allow to easily modify the aspect of the plot symbols used for outliers and extreme values. If
the value activated in the selection box Apply Format to is different than Selected Curve, all settings, except colors (for which
you need to check the Apply Color boxes), are applied to all box curves from the active Layer, from all plot layers in the current
Window or from all 2D plot windows, respectively.

Figure 5.66: The Plot Details Dialog for outliers and extreme values formatting.

5.20.27 Data

The Type list box makes possible to choose the way the information about the binned data points is displayed in a box plot.
There are three modes available: Dots, Bars and Dots + Bars. If the selected data type is Bars or Dots + Bars, the checkbox
Merge Bars Into Single Block becomes active. If checked, this option disables the drawing of the side lines for the individual
bars representing the data bins.
If the option Snap Points to Bin is checked the data symbols are drawn equally spaced in the center of the data bins. Otherwise
they are drawn at randomly selected abscissas, within the bin range.
If you click the Show Statistics button from the Bin Worksheet control group, QtiPlot creates a table containing the computed
quantities of the bins and the dialog is closed. You may check the Add Distribution Curve option in order to add the data used to
create the overlayed distribution curve to this bin table.
The QtiPlot Handbook 169 / 452

Figure 5.67: The Plot Details Dialog for box: Data Formatting.

5.20.28 Distribution

The Distribution Curve control group makes possible to overlay a "pseudo" distribution curve on the binned data by selecting
Normal, Lognormal, Poisson, Exponential, Laplace, Lorentz, Weibull, Kernel Smooth, Gamma or Binomial from the Type drop-
down list. We call these curves "pseudo" distribution curves because they are not the result of a fit operation performed on the
binned data. QtiPlot simply determines the data mean, then overlays the curve so that the means coincide. In the case of a two
parameter distribution, the second parameter taken into account is the standard deviation of the binned data.

Figure 5.68: The Plot Details Dialog: distribution options.

In the case of the Kernel Smooth distribution a new Bandwidth select box becomes available. It provides the following two
options:

Scott The optimal bandwidth of the Kernel Smooth distribution is calculated using the formula: w = 0.9*A*N-0.2 , where N is
the number of bins, A = min(SD, IQR/1.349), SD is the standard deviation and IQR is the interquartile range of the bins
data set.
The QtiPlot Handbook 170 / 452

Silverman The optimal bandwidth of the Kernel Smooth distribution is: w = 1.059*A*N-0.2 , where N is the number of bins, A
= min(SD, IQR/1.349), SD is the standard deviation and IQR is the interquartile range of the bins data set.

If the Scale to Maximum box is checked an input value box becomes visible, allowing you to control the amplitude of the
distribution curve.

5.20.29 Lines

Figure 5.69: The Plot Details Dialog for box: lines options.

5.20.30 Connect

Figure 5.70: The Plot Details Dialog for box: connect options.
The QtiPlot Handbook 171 / 452

5.20.31 Ridgeline Display

The Type list box can be used in order to select the style of a ridgeline curve. There are four default display styles available:
Distribution only, Distribution + Data, Distribution + Rug and Bars. In the last case the distributions are represented using
histograms.
The baseline of a ridgeline curve can be customized using the Position input box.

Figure 5.71: The Plot Details Dialog: ridgeline display options.

By checking the Quantiles goup box it is possible to draw a set of lines at custom positions that can be specified using the Values
text box. Multiple quantile values must be separated by an empty space. The color, width and style of these lines can be easily
customized.
The QtiPlot Handbook 172 / 452

5.20.32 Spacing

Figure 5.72: The Plot Details Dialog for Column, Bar and Histogram curves: Spacing tab.

Figure 5.73: The Plot Details Dialog for Box curves: Spacing tab.
The QtiPlot Handbook 173 / 452

5.20.33 Histogram Data

Figure 5.74: The Plot Details Dialog for histograms: Data Formatting.

If you click the Show Statistics button from the Bin Worksheet control group, QtiPlot creates a table containing the computed
quantities of the bins and the dialog is closed. You may check the Add Distribution Curve option in order to add the data used to
create the overlayed distribution curve to this bin table.
The Hide Bins box is disabled by default. It becomes active only if you choose to display a distribution curve. This can be done
via the Distribution tab. If the Hide Bins box is checked, only the distribution curve is displayed.

5.20.34 Vector

The value typed in the Length spin box determines the length of the arrowheads. Units are measured in points. The Angle value
determines the arrowhead angles in degrees. You may check the Filled box to display filled arrowheads or uncheck it in order to
display the hollow (transparent) arrowheads.
If the vector type is XYXY the End Point controls group is visible and you can select the column that contains the X end point
values from the X End drop-down list and the column that contains the Y end point values from the Y End drop-down list.
The QtiPlot Handbook 174 / 452

Figure 5.75: The Plot Details Dialog for Vector XYXY curves.

If the vector type is XYAM two other control groups become visible: Vector Data and Magnitude.

Figure 5.76: The Plot Details Dialog for Vector XYAM curves.

The Angle drop-down list box from the Vector Data controls group may be used to select either a column that contains the vector
angle values or a constant value. Alternatively you may type a custom constant angle value from 0 to 360 degrees. The angle is
measured counterclockwise.
The QtiPlot Handbook 175 / 452

The Magnitude drop-down list box from the Vector Data controls group may be used to select either a column that contains the
magnitude values or a constant value. Alternatively you may type a custom constant magnitude value. Units are measured either
in pixels or in real world coordinates (Scale Coordinates), depending on the value selected in the Unit drop-down list box from
the Magnitude controls group.
The Multiplier value from the Magnitude controls group may be used to proportionally increase or decrease the length of the
vectors. For example, type 0.5 to draw the vectors at half their original length. The default value is 1.
Finally, it’s worth mentioning that you may change the vector type from XYXY to XYAM and vice versa using the Plot type
drop-down list box from the bottom left corner of this dialog.

5.20.35 Values

This tab is activated by clicking on a contour curve (or on the plotting area) when a 2D plot has been created from a matrix with
one of the following commands from the Plot 3D menu: Contour+Color Fill command, Countour Lines command, Countour
Lines - Color Mapped command, Gray Scale Map command or Heat Map command.

Figure 5.77: The Values tab.

The Values tab allows choosing the matrix that is to serve as the data source for the plot. It is possible to use the formula defined
for the matrix to calculate the plotted Z values by checking the Use matrix formula to calculate values box. This results in higher
accuracy, especially when drawing contour lines, but it only works if the formula uses muParser compatible syntax. The Σ button
becomes available in this case and can be used in order to open the Set Matrix Values dialog.
If you need higher accuracy but the source data matrix can not use an analytical formula to calculate its values you can use the
controls from the Resolution group box. There you can define a larger number of Columns/Rows and press the Resample button.
By doing this the dimensions of the source data matrix will be increased. The values of the new data cells are calculated using
the method selected in the Interpolation box: bilinear interpolation or bicubic interpolation. Please be aware of the fact that the
bicubic interpolation fails if the matrix contains empty cells.
By pressing the x2 button the dimensions of the source matrix are doubled, the values of the new data cells being calculated using
the method selected in the Interpolation box. The /2 button performs the opposite operation: the dimensions of the data source
matrix are divided by two. It is possible to revert all the changes in resolution by pressing the Undo button.
The QtiPlot Handbook 176 / 452

5.20.36 Colors

Figure 5.78: The Colors tab.

There are two groups of controls on this tab. Each group is activated by checking the box next to the group label. The first group
of controls, labeled Image, are used to select the fill type of the contour plot. It is checked when filling of the contour plot is
desired. If unchecked, no fill will be used. If filling is enabled, you may choose between gray-scale, a default color mapping and
a custom color mapping with the 3 radio buttons. The default gray-scale and color maps are shown in the figure below.

You can only customize the colormap when the Custom Colors option is selected. A table with a set of numbers (the Z levels),
and the color corresponding to each Z level, is presented. You can then add, remove or modify levels from the definition of the
colormap. Note that this is only the definition of the colormap - it won’t change the number of contour lines in your plot.
A click on the Level column header opens a dialog alowing to quickly edit the color map levels by specifying their total number
and an intensity range from Minimum to Maximum.
The QtiPlot Handbook 177 / 452

Figure 5.79: Set Equidistant Levels dialog box.

A click on the Color column header opens a dialog alowing to quickly customize the colors in the map by specifying the From
and To colors and a color policy (Two Colors or Custom Color Map). It is also possible to select a color map from a predefined
list of palettes if the current mode is set to Palette.

Figure 5.80: The Two Colors mode of the Gradient Fill dialog box.

Figure 5.81: The Custom Color Map mode of the Gradient Fill dialog box.

Figure 5.82: The Palette mode of the Gradient Fill dialog box.
The QtiPlot Handbook 178 / 452

An example of classical custom colormap is given here:

As long as the Scale Colors checkbox remains checked, Z-values that fall between colormap levels will be displayed in colors
that are interpolated between the colors defined for the bounding levels. It is also possible to define discrete colors for each level.
To do this you must uncheck the Scale Colors checkbox. In this case, no interpolation will be done, and you must define enough
levels in your colormap to produce a desirable result.

The second group of settings must be enabled if you want a bar scale on your plot. You can then define its position and width.

5.20.37 Contour Lines

The Contour Lines tab is used to customize settings applicable to the contour lines. You can select the number of lines and their
color. If you check Use Default Pen, the color of the lines will be defined by the settings in the group of controls to the left of
the checkbox. If you check Use Color Map, the lines will be colored as a function of the Z levels from the colormap defined in
the Colors setting tab. If you check Use Table Custom Pen, the color of the lines will be determined by the settings defined in the
Pen column of the table displaying the Z levels.
The QtiPlot Handbook 179 / 452

Figure 5.83: The Contour Lines tab.

5.20.38 Analysis

Figure 5.84: The Plot Details Dialog for curve analysis operations.

The Analysis tab is available only for plot curves that are the result of an analysis operation (also called an analysis filter). This
tab allows to access and edit the properties of the analysis object attached to the plot curve. It also makes possible to remove the
analysis filter by clicking the Delete button.
The Edit... button on the right side of this tab closes the current dialog and opens a new dialog that allows to modify the properties
The QtiPlot Handbook 180 / 452

of the analysis object. Generally it is the same dialog that was used in order to perform the analysis operation. Please note that
not all operations can be edited and if this is the case for the current one the Edit... button is disabled.
By clicking the Copy button the analysis operation is stored to memory and can be applied later on to any other data curve from
any plot layer by right-clicking on it and selecting the action Paste Operation from its pop-up context menu.
For all analysis operations there is a mechanism available in QtiPlot that allows to trigger a recalculation when the data source is
modified. It is possible to specify the desired recalculation mode using the Recalculate list box. The available options are:

No - No recalculation when data changes.


Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead the user can perform a recalculation at any time by pressing
the Recalculate button.

The complete name of the column which is the data source for the operation, as well as the data range are indicated in the Dataset
text box. By clicking the Go to Column button the table window that contains this column is activated and the source column is
selected.
If the analysis operation is a data fit operation an additional set of controls are available: the Parameters Table and the Covariance
Matrix text boxes and their corresponding Go to Window buttons. By clicking any of the Go to Window buttons the corresponding
table/matrix window is activated if it already exists, otherwise it will be created using the name provided in the text box.
All the functionality provided by the controls in this dialog tab can be accessesd by right-clicking on a plot curve and selecting
the Analysis item from the pop-up context menu.

Figure 5.85: Context menu for a Lorentz data fit analysis operation.

5.21 Vertical Cursor

This dialog pops-up when you use the Vertical Cursor... command. By default, it displays a table that gives quick access to the
values of the data points for all curves in a plot layer. The names of the curves available in the active plot layer are listed in
The QtiPlot Handbook 181 / 452

the first column of this table. The second column displays the Y value corresponding to the X position of the cursor. The third
column, called Show, enables/disables the display of the Y labels attached to each data curve in the plot layer. The << button
can be used in order to hide this data table.

Figure 5.86: The Vertical Cursor... dialog box.

The X input box allows to manually and precisely set the position of the cursor. If a plot curve does not contain a data point with
the specified abscissa, QtiPlot uses liniar interpolation in order to calculate the corresponding Y value.
The Layer input box can be used in order to change the active plot layer while the Font input box allows the user to increase or
decrease the font size of the Y labels.
By default, the color of the vertical cursor is red and the line width is set to 1. These values can be customized using the Pen spin
box and the color button located just after it.
When pressing the Table button, QtiPlot creates a new table with the Y values of all data curves in the active plot layer at the
selected X coordinate. If the results table already exists, a new row of data is appended to it.
The Help button opens the quick help panel when pressed.
If the Snap Cursor to Nearest Data Point box is unchecked, the vertical cursor can be moved freely when holding the left button
of the mouse pressed or when pressing the Left and Right arrow keys. Otherwise, when you move the cursor, its position will be
automatically set to the nearest data point.

5.22 Define surface plot

This dialog is used when you enter the New -> New Function Plot -> New 3D Surface Plot... command. It allows for the
creation of a new function of two variables. When the "Function" Surface type is selected the coordinate system will be Cartesian
and the function will be of the form: z = f(x,y).
The QtiPlot Handbook 182 / 452

Figure 5.87: The New -> New Function Plot -> New 3D Surface Plot... dialog box.

It is also possible to input a string in the Comment field of this dialog. If a non empty string is typed in this field, it will be
displayed by the 3D legend objects instead of the mathematical formula(s) of the analytical/parametrical surface.
You may also define the X, Y and Z scales and the mesh parameters.
You can create parametric surfaces when the "Parametric" Surface type is selected. The only parameters allowed are latitude and
longitude: u and v. Here, for example, is how you might plot a sphere having a radius equal to one:

Figure 5.88: The New -> New Function Plot -> New 3D Surface Plot... dialog box.

As in the case for functions, you can supply the drawing domain for the two angular parameters and you can define the mesh
parameters. The more rows/columns you request, the better the resolution of the output image will be. However, this is at the
cost of a larger memory consumption and an increased time of computation. A slow CPU and small amounts of memory will be
limiting.
The QtiPlot Handbook 183 / 452

It is possible to provide information to the drawing routines about the rotational symmetry of the parametric surface using the
two Periodic check box options (one for each parameter).
Finally, it is worth knowing that if you type a mathematical expresion containing the name of the number pi or of any other
physical constant, like the universal gravitational constant (g), in the input range boxes for the parameters, the expression will be
automatically evaluated by QtiPlot and the result will be displayed in the input box.

5.23 Export Graph Dialog

This dialog is activated by selecting the Export Graph command from the File Menu. The command appears in the file menu
whenever a graph window is selected.
The file Name as well as the Path where the image will be saved can be chosen by pressing the file system browsing buttons at
the right. They can also be edited manually. Please note that QtiPlot provides an auto-completion mechanism when editing the
file path.
All graphs, or one graph at a time, can be exported in any of the available image formats. Depending upon the image format
chosen, you may be able to customize various image file parameters as well as the size of the exported image.
For the .bmp, .pbm, .jpeg, .xbm, .pgm, .ppm image formats, the only available option is the quality of the image. This parameter
defines the image compression ratio, and may be set to any value between 1 and 100%. Higher values produce a better quality
image and a larger file, while lower values result in increasingly lossy compression, degraded image quality, and smaller file size.
For .png, .tiff and .xpm, there is an option to choose a transparent background.

For .eps, .pdf and .ps file formats, the option dialog is different, see screenshot bellow. If the option Export as embedded image
is checked, the output file is only a wrapper around a raster image of the 2D plot layer/window. For a real vectorial output this
option should be unchecked.
In the case of a vectorial output, the Native fonts option becomes available. If checked, the text strings that contain only characters
from the Code Page 1252 Windows Latin 1 (ANSI) will be exported as text objects, all other text strings being converted to paths
and exported as drawing objects. The number of native text fonts is limited to the standard fonts provided by the PostScript and
PDF formats (Times, Helvetica and Courier with their bold and/or oblique/italic variants). If the Native fonts option is unchecked
all text strings will be converted to drawing paths.
The QtiPlot Handbook 184 / 452

By default the plot is exported to its real size on screen, but if you wish, you can choose a different size by checking the Custom
print size box. In addition, there is a Keep aspect ratio option. If you check this box and modify one dimension of a plot, the
other dimension will automatically be modified to keep the plot’s aspect ratio the same.
The Scale Factor control can be used in order to customize the width of the exported lines, the size of the plot symbols, the length
of axes ticks, the spacing between axes and tick labels, etc... If set to zero, this control displays the text Automatic and QtiPlot
calculates a scaling factor based on the proportion between the custom export size and the actual size of the 2D plot. If set to
one, all plot elements enumerated above keep their user defined values when exported. The same considerations are valid for the
Scale Fonts Factor option, which can be used in order to fine tune the size of the exported fonts.
When exporting multi-layer 2D plot windows the option Clip space around layers is also available. If this option is checked
QtiPlot uses the bounding rectangle of the layers to calculate the size of the exported image. Otherwise the size of the image is
equal to the interior size of the graph window (the frame and the title bar of the window being excluded).
When exporting the plot to LaTeX (.tex) there are two very useful options: Export font sizes and Escape special characters in
texts. If checked, the first option will include LaTeX commands in the output which keep the original font sizes. If not checked,
the font size specified in the preamble of the TeX document will be used for all text strings in the plot. The second option
specifies whether LaTeX special characters ($ _ { } ˆ % #) should be escaped or not when exporting. If the title or the axis labels
contain LaTeX syntax (like superscripts, subscripts, etc...), and you want them to be interpreted by the LaTeX compiler, you must
uncheck this option.

When exporting 3D plot windows to a vectorial image format (.eps, .pdf, .ps, .pgf or .svg) the option Export 3D texts as becomes
available, allowing to choose the output method for texts. If this option is set to Bitmap images all text strings will be exported as
raster images embedded in the output file. If you choose the Native fonts method the number of available text fonts is limited to
The QtiPlot Handbook 185 / 452

the standard fonts provided by the PostScript and PDF formats (Times, Helvetica and Courier with their bold and/or oblique/italic
variants). If the LaTeX file method is used, the texts are not be included in the output file, instead QtiPlot generates an extra .tex
file, having the same base name and containing all the text strings from the 3D plot window, with their exact positions, colors
and font sizes. By compiling this .tex file using a locally installed LaTeX compiler it is possible to get a vectorial output image
that includes your custom fonts. If the path to the local LaTeX compiler is correctly specified via the File Locations tab of the
Preferences dialog and you choose to export a 3D plot to .pdf using the LaTeX file method for the export of text strings, QtiPlot
will automatically launch a compilation process using the pdflatex executable that is normally located in the same folder as the
latex compiler. The .tex file containing the text strings is automatically deleted by QtiPlot at the end of the compilation process.

It is also possible to export animated 3D plot windows to .avi movie files. In this case there are three options available: the total
number of Frames, the Frame Rate (which is the number of frames per second) and the Image quality. Internally QtiPlot exports
each animation frame as a JPG image.
The QtiPlot Handbook 186 / 452

5.24 Fast Fourier Transform Dialog

The FFT... dialog box can be used on a plot, on a table or on a matrix. It is used to compute either the direct or inverse FFT. See
the FFT section in the Analysis chapter for an example.

Figure 5.89: The FFT... dialog box for a curve.

QtiPlot creates a hidden table with seven columns which contain the values for the frequencies, the real part (Re), the imaginary
part (Im), the magnitude M = sqrt(Re2 + Im2 ), the amplitude (A), the phase Ph = atan(Im/Re) and the amplitude in decibels of
the FFT, dB = 20log(A).
QtiPlot uses the values from the hidden table in order to create a 2D plot window with one or two layers. The type of curves
displayed can be customized using the Plot list box. By default, QtiPlot creates two plot layers displaying the amplitude and the
phase of the FFT.
It is possible to apply a window function to the input data, by choosing an option different then Rectangular in the Window list
box. The available window functions, w(i), are listed bellow, N being the number of samples (data points) in the input signal and
i the index of the data point, i = 0, 1,..., N - 1:

Rectangular w(i) = 1. The input data is not altered.


Welch w(i) = 1 - [2(i - 0.5*(N - 1))/(N + 1)]2

Triangular w(i) = 2/N[N/2 - |i - N/2|]


Bartlett w(i) = 2/(N - 1)*[(N - 1)/2 - |i - (N - 1)/2|]
Hanning w(i) = 0.5*[1 - cos[2πi/(N - 1))]
Hamming w(i) = 0.54 - 0.46 cos[2πi/(N - 1)]

Blackman w(i) = 0.42 - 0.5 cos[2πi/(N - 1)] + 0.08 cos[4πi/(N - 1)]


Gaussian w(i) = exp[-0.5(2α(i - N/2)/N)2 ], where α may be customized using the Alpha input box which is only available in
the case of this window type. If the Alpha value is set to zero the input data is not altered.

If the Normalize Amplitude box is checked, the amplitude curve is normalized to 1. If not, the amplitude is calculated from the
magnitude values using the following formulas: Ai = Mi /N for i = 0 or i = N/2 and Ai = 2Mi /N otherwise.
If the Shift Results check box is on, the frequencies are shifted in order to obtain a centered x-scale.
The QtiPlot Handbook 187 / 452

Figure 5.90: The FFT... dialog box for a table.

When performing an FFT on a table, you must select the sampling column (X-values) and one (for simple real values) or two (for
complex values) columns of Y-values. Complex numbers have the real part of the Y-values in the first column and the imaginary
part of the Y-values in the second column. If Y-values are simple reals, you don’t have to select a column for the imaginary part.
You can leave the combo box for the second column empty in this case.
By default, the Sampling Interval corresponds to the interval between X-values. Giving a smaller value makes no sense, but you
can increase this value in order to sample fewer values.
On matrices QtiPlot performs a two dimensional FFT using two sampling intervals: one that corresponds to the interval between
the X-values and a second one corresponding to the interval between the Y-values. For more details about the two dimensional
FFT please read the following article by Paul Bourke: http://paulbourke.net/miscellaneous/dft/.

Figure 5.91: The FFT... dialog box for a matrix.

If the dimensions of the input matrix are not powers of 2, you have the option to resize it for a more efficient FFT, by checking
the box Zero-pad to nearest power of 2 size. The new dimensions are calculated to be the closest powers of 2 from the initial
dimensions of the matrix and the extra data values used for the FFT are set to zero.
As the result of the FFT operation on a matrix QtiPlot creates a new matrix window containing the amplitude of the FFT, along
with two other matrices which contain the real and the imaginary parts of the FFT.

5.25 FFT Filter Dialog

The FFT Filter Dialog can be used on a plot or on a matrix. When the active window is a 2D plot this dialog can be used to
apply a one dimensional FFT filter to any of the curves in the active plot layer, see the filtering section for more details.
The QtiPlot Handbook 188 / 452

If the filter type is set to Low Pass FFT Filter QtiPlot removes all the frequencies above a cut-off frequency from the input signal,
while keeping the other frequencies unaltered. You can select the cut-off frequency of the filter using the Frequency cutoff input
box.

Figure 5.92: The FFT Filter -> Low Pass... dialog.

If the filter type is set to High Pass FFT Filter QtiPlot sets to zero all the frequencies below the specified cut-off frequency. You
can decide if the DC offset (zero frequency) should be kept or not in the filtered signal by checking the Keep DC Offset box.

Figure 5.93: The FFT Filter -> High Pass... dialog.

If the filter type is set to Band Pass FFT Filter QtiPlot cuts both high and low frequencies present in an input signal. You can
select the curve to filter and both the low and high cutoff frequencies of the filter. Also, you can decide if the DC offset (zero
frequency) should be kept or not in the filtered signal by checking the Keep DC Offset box.

Figure 5.94: The FFT Filter -> Band Pass... dialog.


The QtiPlot Handbook 189 / 452

If the filter type is set to Band Block FFT Filter QtiPlot removes a band of frequencies from a signal while leaving those
frequencies above and below the stop band. You can select the curve to filter and both the lower and upper stop-band frequencies
of the filter. Also, you can decide if the DC offset (zero frequency) should be kept or not in the filtered signal by checking the
Keep DC Offset box.

Figure 5.95: The FFT Filter -> Band Block... dialog.

After performing the operation QtiPlot creates a new table containing the filtered data, and adds a new curve to the current layer.
The curve is a plot of the filtered data.
If the active window is a matrix the FFT Filter Dialog can be used to apply a two dimensional FFT filter, for more details see
the following article by Paul Bourke: http://paulbourke.net/miscellaneous/imagefilter/.

Figure 5.96: The FFT Filter Dialog dialog box for a matrix.

Please note that the input matrix will be modified in order to store the filtered data, but you can revert all the changes by pressing
the Undo button.

5.26 Find Peaks Dialog

This dialog box is opened when you select the Peaks... command from the Analysis menu. By pressing the Find button QtiPlot
performs a search on the selected curve using the first derivative method. This method is based on the fact that the first derivative
of a function at a local extreme point is equal to zero. The limits of the search range can be specified via the From Xmin and To
Xmax input boxes.
The QtiPlot Handbook 190 / 452

Figure 5.97: The Find Peaks dialog box.

The Direction drop-down list can be used in order to specify which type of peaks should be detected: only Positive peaks, only
Negative peaks or Both positive and negative peaks.
The Filter Height can be used to specify the minimum height of the found peaks. It is defined as follows: if it is set to zero the
standard deviation of the data is used as a threshold height else it is a percent of the maximum value of the dataset.
It is possible to specify the method to smooth the derivative of the spectrum data. The available methods are:

1. None: Do not use any smoothing method.


2. Savitsky-Golay: Specifies the Savitsky-Golay method to get smooth the derivative.
3. FFT: Specifies the FFT Filter method to smooth the derivative.
4. Moving Window Average: Specifies the Moving Window Average method to smooth the derivative.

In the Display group select the Center check box to mark the center of the peaks. The line style of the plotted peaks can also be
specified.
Select the Labels check box to display labels on the data plot for each peak found. It is possible to select the type of center labels:

1. X: Use the X coordinates of the peak centers as center labels.


2. Y: Use the Y coordinates of the peak centers as center labels.

3. Row Indices: Use the indices of the peaks as center labels.


4. (X,Y): Use the X and Y coordinates of the peak centers as labels.

Use the Rotate -90 check box to specify whether or not to rotate the center labels.

5.27 Frequency Count Dialog

This dialog is activated by selecting the Frequency Count command from the Analysis -> Descriptive Statistics menu. It can be
used in order to calculate the frequency distribution of the data values from a table column.
The QtiPlot Handbook 191 / 452

Figure 5.98: The Frequency Count dialog.

Internally QtiPlot sorts the input data and detects the minimum and the maximum values which are displayed in the From
Minimum and To Maximum input boxes. Then it creates a set of bins in this range using either the specified Bin Size or the
Number of Bins defined by the user.
When pressing the Apply button QtiPlot counts the number of times a data value falls within a bin. Data values equal to the
low-edge of a bin are included in the bin while values equal to the upper-edge of the bin are excluded from it, but they are
counted in the next bin (if any).
The results are placed in a newly created table which contains seven columns with a row for each bin. The values displayed in
these rows are: the center value of the bin, the lower and upper limits of the bin, the number of values in the bin, the cumulative
count up to that bin and the relative and cumulative frequencies, respectively.
The relative and cumulative frequencies are expressed either as a Percent or as a Fraction, depending on the value specified in
the Frequency list box from the Output Settings group.

5.28 Bland-Altman Plot Dialog

This dialog is activated by selecting the Bland-Altman Plot... command from the Plot -> Statistical Graphs menu. It can be used
in order to create and customize a Bland-Altman plot of the selected data columns in the active table window.

5.28.1 Data Tab

5.28.1.1 Design 1: One data-pair per subject

A Bland-Altman plot is used to compare two measurements of the same variable. That is, it is a method comparison technique.
In the initial design of this analysis, that has been used for many years, each of the two measurement methods is used once on
each subject. You need to provide two input data columns, one for each measurement method, via the Method 1 and Method 2
list boxes. The Subject box should be set to None in this design. A big drawback of this simple design is that no repeatability
parameter can be computed.
The QtiPlot Handbook 192 / 452

Figure 5.99: Bland-Altman Plot... dialog: Data tab for single measurements.

Considering n paired observations for method 1 (M1k ) and method 2 (M2k ), with k = 1, 2,...,n, the simplest form of a Bland-
Altman plot is obtained by plotting the differences dk = M1k - M2k on the Y axis versus the pair means (M1k + M2k )/2 on the X
axis.
A horizontal line representing the bias is drawn at the mean difference: dmean = ∑dk /n.
Two other horizontal lines, known as the limits of agreement (LoA ) are added to the plot at:
LoAup,low = dmean ± 1.96 Sd
where Sd is the standard deviation:
Sd = [1/(n-1)∑(dk - dmean )2 ]1/2
Sometimes the 1.96 multiplier for the standard deviation is replaced with 2 or with another value. The default value in the
Multiplier (SD) box is therefore set to 1.96 and can be freely modified.

5.28.1.1.1 Confidence Intervals

The α% confidence interval for the mean difference (the bias) is calculated as dmean ± t(1 + α)/2,n-1 V1/2 , with the variance: V =
Sd 2 /n and t(1 + α)/2,n-1 being the Student’s t distribution with n - 1 degrees of freedom. The default value for α is set to 95 in the
Confidence Level (%) box.
The α% confidence interval for the limits of agreement is calculated as:
LoAup,low ± t(1 + α)/2,n-1 VLoA 1/2
with the variance:
VLoA = [1/n + 0.5*1.962 /(n-1)]Sd 2
There are four display modes available for the X axis of a Bland-Altman plot:

Mean The abscissas are calculated as the arithmetic mean of the paired values. This is the default mode.
Method1 The abscissas are the values measured using the first method.
Method2 The abscissas are the values measured using the second method.
GeometricMean The abscissas are calculated as the geometric mean of the paired values.

There are three display modes available for the Y axis of a Bland-Altman plot:
The QtiPlot Handbook 193 / 452

DifferencePercent The ordinates are calculated as the difference of the paired values, divided by their arithmetic mean and
multiplied by 100.
Difference The ordinates are calculated as the difference of the paired values. This is the default mode.
Ratio The ordinates are calculated as the ratios of the paired values.

5.28.1.2 Design 2: Repeated measurements for each method

Multiple observations by each method on each subject are needed in order to compare the repeatability of the two methods. For
this more complex design of the Bland-Altman analysis three columns of input data are required: one with the measurements of
the first method, one with the measurements of the second method and one with the subject values.
In this design only one display mode is available for the Y axis of a Bland-Altman plot: the default Difference mode. Also, the
result curve displays the data points corresponding to each subject with a different color.

Figure 5.100: Bland-Altman Plot... dialog: Data tab with Subject column for repeated measurements.

Two methods are available for calculating the Confidence interval for the limits of agreement (LoA) in the case of replicated
measurements: Delta method and MOVER (Method of Variance Estimates Recovery). The calculation steps for each of these
two methods are explained in detail by GY Zou in his paper Confidence interval estimation for the Bland-Altman limits of
agreement with multiple observations per individual, Statistical Methods in Medical Research, 2013 Dec;22(6):630-42.
The use of the option True Value is Constant is very clearly explained by Bland and Altman in their paper from 2007 Agreement
between methods of measurement with multiple observations per individual, Journal of Biopharmaceutical Statistics, 17: 571-
582: "There are two different situations to consider for replicated data. We can think of the observations for the same subject
as a series of measurements of a quantity that does not vary over the period of observation... Or we can think of them as pairs
of measurements by two methods of a changing quantity, where it is the instantaneous measurement for the subject which we
want to capture....The distinction is important, as it determines whether we need to consider pairing of observations by the two
methods. Indeed, for the first (constant) case we do not require equal replication of each method for each individual, whereas
this is a requirement for the second (non-constant) case."
If the option True Value is Constant is checked, the data columns for Method 1 and Method 2 may have a different number of input
cells, since pairing is not required. The calculations for the limits of agreement and the corresponding confidence intervals will
take into account the different number of observations for each method, nevertheless, only paired observations will be displayed
by the output result curve.
By checking the option Plot Subjects as Bubbles, it is possible to group the measurements for each subject and represent them
as one bubble with the center located at the following coordinates: mean of group (X) and mean difference (Y). The sizes of
the bubbles are proportional to the number of replicates. This option does not affect in any way the calculations of the various
reported values, only the drawing of the result data curve.
The QtiPlot Handbook 194 / 452

5.28.2 Lines Tab

This tab helps controlling the drawing of the various horizontal lines: the equality line (Zero difference), the bias (Mean differ-
ence) and the limits of agreement. The drawing of the confidence intervals, their color filling and opacity can also be customized
via this tab.

Figure 5.101: Bland-Altman Plot... dialog: Lines tab.

5.28.3 Output Settings Tab

The Table button, when pressed, activates the results table. The user may type the name of the result table in the edit box. Please
beware that if the name corresponds to an existing table, the contents of that table will be altered.

Figure 5.102: Bland-Altman Plot... dialog: Output Settings tab.

The last two columns in the result table, Statistics and Values, display the names and, respectively, the values calculated for the
bias (Mean), the limits of agreement (Mean ± Multiplier*SD) and their corresponding confidence intervals. Other two calculated
values are the Mean of Pairwise Means or MPM, which is the mean of all paired values and the Bland-Altman Ratio, which is
calculated as: (LoAup - LoAlow )/MPM. In the case of repeated observations, these columns also display the information about
the True Value is Constant setting (1 if checked, 0 if not) and about the method used to calculate the confidence intervals for the
limits of agreement (Delta or Mover).
The QtiPlot Handbook 195 / 452

5.29 Q-Q Plot Dialog

This dialog is activated by selecting the Q-Q Plot... command from the Plot -> Statistical Graphs menu. It can be used in order
to create and customize a Q-Q (quantile-quantile) plot of the selected data column in the active table window.

Figure 5.103: The Frequency Count dialog.

The N valid input data values xi are first sorted ascendingly: x1 ≤ x2 ≤ ... ≤ xN . After that the index i of the ordered values is
used to calculate a score (s) using one of the five methods listed below:

Blom (default): s = (i - 0.375)/(N + 0.25)


Benard s = (i - 0.3)/(N + 0.4)

Hazen s = (i - 0.5)/N
VanDerWaerden s = i/(N + 1)
KaplanMeier s = i/N

The sorted values are represented on the Q-Q plot by points whose X coordinates are the xi values and whose Y coordinates are
calculated using the inverse of the cumulative distribution functions of the s scores calculated above.
There are five distributions available for Q-Q plots and the inverse of their cumulative distribution functions are calculated using
the following formulas (available with muParser as script engine):

Normal (default): normalinv(s, m, sd), where m is the arithmetic mean and sd is the standard deviation of the input data set.
Lognormal logninv(s, scale, shape)
Exponential expinv(s, m), where m is the arithmetic mean of the input data set.
Weibull wblinv(s, scale, shape)

Gamma gaminv(s, shape, scale)

The scale and shape parameters that are used for the Lognormal, Weibull and Gamma distributions are calculated using the
maximum likelihood estimation (MLE) method.
The QtiPlot Handbook 196 / 452

5.30 Normality Test (Shapiro-Wilk) Dialog

This dialog is activated by selecting the Normality Test (Shapiro-Wilk)... command from the Statistics -> Descriptive Statistics
-> menu.
The Shapiro-Wilk method can be used to test the null hypothesis that a data sample came from a normally distributed population.
The Wikipedia article on the Shapiro-Wilk test makes for excellent reading on this topic.

Figure 5.104: The Normality Test (Shapiro-Wilk) dialog.

5.31 One sample t-Test Dialog

This dialog is activated by selecting the One Sample t-Test... command from the Statistics -> Hypothesis Testing -> menu.
A t-test is any statistical hypothesis test in which the test statistic follows a Student’s t-distribution under the null hypothesis. It
is assumed that the data is normally distributed. The Wikipedia article on the Student’s t-test makes for excellent reading on this
topic.
The QtiPlot Handbook 197 / 452

Figure 5.105: One sample t-Test dialog.

The one-sample form of a t-Test compares the mean (m) of a population to a mtest value specified in the null hypothesis. By
default QtiPlot performs a two-tailed test, the default alternate hypothesis being that the mean of the population and the mtest
values are different (m <> mtest ). It is also possible to perform an upper-tailed test by choosing the alternate hypothesis that m >
mtest or a lower-tailed test (m < mtest ).
This test uses the statistic t = N1/2 (m-mtest )/SD, where N is the size of the population and SD is the standard deviation, SD =
[Σ(xi - m)2 /(N-1)]1/2 .
The test statistic is used to compute a probability (P value). For a lower-tailed test the probability is calculated using the formula
p = tcdf(t, DoF), where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-
distribution with DoF = N-1 degrees of freedom. For an upper-tailed test, the probability is calculated using the formula p =
1-tcdf(t, DoF). For a two-tailed test the probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p
= 2[1-tcdf(t, DoF)] otherwise.
The null hypothesis is rejected if the calculated probability is lower than the value of the Significance Level.
If the Confidence Interval(s) box is checked QtiPlot also computes a confidence interval (Lower Limit and Upper Limit) for each
user defined level.

5.32 Two sample t-Test Dialog

This dialog is activated by selecting the Two Sample t-Test... command from the Statistics -> Hypothesis Testing -> menu.
A t-test is any statistical hypothesis test in which the test statistic follows a Student’s t-distribution under the null hypothesis. The
two sample t-test can be used to determine if two sets of data are significantly different from each other. It is assumed that the
data is normally distributed. Please visit the Wikipedia article on the Student’s t-test for more details about this statistical test.
The QtiPlot Handbook 198 / 452

Figure 5.106: Two sample t-Test dialog.

The two-sample form of the t-Test compares the difference between the means (m1 -m2 ) of the two data sets to a mtest difference
specified in the null hypothesis. Setting the test difference to 0 is equivalent to testing the equality of the means. By default
QtiPlot performs a two-tailed test, the default alternate hypothesis being that the difference between means and mtest are different
(m1 -m2 <> mtest ). It is also possible to perform an upper-tailed test by choosing the alternate hypothesis that m1 -m2 > mtest or a
lower-tailed test (m1 -m2 < mtest ).
This test uses the statistic t = (m1 -m2 -mtest )/[Sp (1/N1 +1/N2 )1/2 ], where Sp is the pooled variance of the two samples and N1 and
N2 are the sizes of the two data sets.
For an independent test Sp = [((N1 -1)V1 +(N2 -1)V2 )/(N1 +N2 -2)]1/2 , where V1 and V2 are the sample variances. For a paired test
N1 = N2 and Sp is calculated as the variance of the differences between the corresponding values from the two samples.
The test statistic is used to compute a probability (P value). For a lower-tailed test the probability is calculated using the formula
p = tcdf(t, DoF), where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-
distribution with DoF degrees of freedom. For a paired test DoF = N-1, where N = N1 = N2 is the common size of the two data
sets, whereas for an independent test DoF = N1 +N2 -2. For an upper-tailed test, the probability is calculated using the formula p
= 1-tcdf(t, DoF). For a two-tailed test the probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and
p = 2[1-tcdf(t, DoF)] otherwise.
The null hypothesis is rejected if the calculated probability is lower than the value of the Significance Level.
If the Confidence Interval(s) box is checked QtiPlot also computes a confidence interval (Lower Limit and Upper Limit) for each
user defined level.
The QtiPlot Handbook 199 / 452

5.33 Chi-square Test Dialog

This dialog is activated by selecting the Chi-square Test for Variance... command from the Statistics -> Hypothesis Testing ->
menu. A chi-squared test is any statistical hypothesis test where the sampling distribution of the test statistic is a chi-squared
distribution when the null hypothesis is true. Please visit the Wikipedia article on the Chi-squared test for more details about this
statistical test.

Figure 5.107: The Chi-square Test for Variance dialog.

The chi-square compares the variance (V) of a population to a Vtest value specified in the null hypothesis. By default QtiPlot
performs a two-tailed test, the default alternate hypothesis being that the variance of the population and the Vtest values are
different (V <> Vtest ). It is also possible to perform an upper-tailed test by choosing the alternate hypothesis that V > Vtest or a
lower-tailed test (V < Vtest ).
This test uses the Chi-Square statistic, χ 2 = (N-1)V/Vtest , where N is the size of the population.
The test statistic is used to compute a probability (P value). For a lower-tailed test the probability is calculated using the formula
p = chi2cdf(χ 2 , DoF), where the chi2cdf function calculates the lower tail of the cumulative distribution function for the chi-
squared distribution with DoF = N-1 degrees of freedom. For an upper-tailed test, the probability is calculated using the formula
p = 1-chi2cdf(χ 2 , DoF). For a two-tailed test the probability is calculated using the formulas p = chi2cdf(χ 2 , DoF) if chi2cdf(χ 2 ,
DoF) < 0.5 and p = 2[1-chi2cdf(χ 2 , DoF)] otherwise.
The null hypothesis is rejected if the calculated probability is lower than the value of the Significance Level.
If the Confidence Interval(s) box is checked QtiPlot also computes a confidence interval (Lower Limit and Upper Limit) for each
user defined level.

5.34 One-way ANOVA Dialog

This dialog is activated by selecting the One-Way ANOVA... command from the Statistics -> ANOVA -> menu. The one-way
analysis of variance (abbreviated one-way ANOVA) can be used to compare the means of two or more samples using the F
distribution. Please visit the Wikipedia article on the one-way ANOVA for more details about this statistical test.
The QtiPlot Handbook 200 / 452

Figure 5.108: The one-way ANOVA dialog.

5.34.1 Post-hoc tests

If the controls in the Means Comparison group box are checked QtiPlot can also perform several post-hoc analysis tests. These
tests can determine which sample means are significantly different from each other. The folowing post-hoc tests are currently im-
plemented: Tukey, Bonferroni, Dunn-Sidak, Fisher’s Least Significant Difference (LSD), Scheffe, Holm-Bonferroni and Holm-
Sidak.
The post-hoc tests compare all possible pairs of means, meaning that for N samples there are k = N(N-1)/2 pairs of means to be
compared.
For each pairwise comparison QtiPlot computes the difference between the means mi and mj and the Standard Error of the Mean,
SEMij = [MSE*(1/ni + 1/nj )]1/2 , where MSE is the Mean Square for the Error reported in the ANOVA results table and ni and
nj are the sizes of samples i and j respectively. QtiPlot also computes a test statistic based on the difference between the means
and on the SEMij , a probability p and a confidence interval (LCL stands for Lower Confidence Limit and UCL stands for Upper
Confidence Limit).
The compaired means are said to be significantly different (reported Significance is 1 in the results log/tables) at significance
level α (0 ≤ α ≤ 1) if the calculated probability is lower than the value of α chosen by the user.
For each test QtiPlot calculates the test statistics and the probabilities using the following formulas:

1. Tukey:
This test uses the Studentized range statistic q = 21/2 |mi - mj |/SEMij .
The probability is calculated using the formula p = 1 - srangecdf(q, DoF, N), where the QtiPlot function srangecdf com-
putes the probability associated with the lower tail of the distribution of the Studentized range statistic for N samples and
DoF degrees of freedom (reported in the Error line of the ANOVA results table).
The implementation of the srangecdf function provided by QtiPlot uses code adapted from the following paper by
WILLIAM P. DUNLAP, RICHARD S. POWELL and TED K. KONNERTH:A FORTRAN IV function for calculating
probabilities associated with the studentized range statistic, published in Behavior Research Methods and Instrumentation,
1977, Vol. 9 (4), 373-375.
2. Bonferroni:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formula p = N(N-1)tcdf(t, DoF), where the tcdf function calculates the lower tail of
the cumulative distribution function for the Student’s t-distribution with DoF degrees of freedom.
The QtiPlot Handbook 201 / 452

3. Dunn-Sidak:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formula p = 1 - [1 - tcdf(t, DoF)]N(N-1) , where the tcdf function calculates the lower
tail of the cumulative distribution function for the Student’s t-distribution with DoF degrees of freedom.

4. Fisher LSD:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
5. Scheffe:
This test uses the statistic F = t2 , where t = (N-1)1/2 (mi - mj )/SEMij .
The probability is calculated using the formula p = 1 - fcdf(F, N-1, DoF), where the fcdf function calculates the lower tail
of the cumulative distribution function for the F-distribution with N-1 andDoF degrees of freedom.

6. Holm-Bonferroni:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
The Holm-Bonferroni test sorts the p-values in ascending order and compares them to nominal significance levels from
α/k to α, namely the values: α/k, α/(k-1),...,α/2, α.
7. Holm-Sidak:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
The Holm-Sidak test sorts the p-values in ascending order and compares them to nominal significance levels from 1 - (1 -
α)1/k to α, namely the values: 1 - (1 - α)1/k , 1 - (1 - α)1/(k-1) ,...,1 - (1 - α)1 .

5.35 Two-way ANOVA Dialog

This dialog is activated by selecting the Two-Way ANOVA... command from the Statistics -> ANOVA -> menu. The two-way
analysis of variance (abbreviated two-way ANOVA) can be used to compare the means of two or more samples using the F
distribution. Please visit the Wikipedia article on the Analysis of Variance for more details about this statistical test.
In the QtiPlot implementation of two-way ANOVA there are only two factors defined, A and B, with LA and LB levels respec-
tively, for a total number of samples N = LA LB .
The QtiPlot Handbook 202 / 452

Figure 5.109: The two-way ANOVA dialog.

5.35.1 Post-hoc tests

If the controls in the Means Comparison group box are checked QtiPlot can also perform several post-hoc analysis tests. These
tests can determine which level means or sample means (if the Interactions box is checked) are significantly different from
each other. The folowing post-hoc tests are currently implemented: Tukey, Bonferroni, Dunn-Sidak, Fisher’s Least Significant
Difference (LSD), Scheffe, Holm-Bonferroni and Holm-Sidak.
The post-hoc tests compare all possible pairs of level means, meaning that for Li levels per factor there are k = Li (Li -1)/2 pairs
of means to be compared for each factor. If the Interactions box is checked QtiPlot also compares all possible pairs of sample
means, meaning that for the N samples there are N(N-1)/2 pairs of means to be compared.
For each pairwise comparison QtiPlot computes the difference between the means mi and mj and the Standard Error of the Mean,
SEMij = [MSE*(1/ni + 1/nj )]1/2 , where MSE is the Mean Square for the Error reported in the ANOVA results table and ni and
nj are the sizes of levels i and j respectively. QtiPlot also computes a test statistic based on the difference between the means
and on the SEMij , a probability p and a confidence interval (LCL stands for Lower Confidence Limit and UCL stands for Upper
Confidence Limit).
The compaired means are said to be significantly different (reported Significance is 1 in the results log/tables) at significance
level α (0 ≤ α ≤ 1) if the calculated probability is lower than the value of α chosen by the user.
For each test QtiPlot calculates the test statistics and the probabilities using the following formulas:

1. Tukey:
This test uses the Studentized range statistic q = 21/2 |mi - mj |/SEMij .
The probability is calculated using the formula p = 1 - srangecdf(q, DoF, L), where the QtiPlot function srangecdf computes
the probability associated with the lower tail of the distribution of the Studentized range statistic for L the number of levels
in factor A or factor B and DoF degrees of freedom (reported in the Error line of the ANOVA results table).
The implementation of the srangecdf function provided by QtiPlot uses code adapted from the following paper by
WILLIAM P. DUNLAP, RICHARD S. POWELL and TED K. KONNERTH:A FORTRAN IV function for calculating
The QtiPlot Handbook 203 / 452

probabilities associated with the studentized range statistic, published in Behavior Research Methods and Instrumentation,
1977, Vol. 9 (4), 373-375.
2. Bonferroni:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
3. Dunn-Sidak:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.

4. Fisher LSD:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.

5. Scheffe:
This test uses the statistic F = t2 , where t = (mi - mj )/SEMij .
The probability is calculated using the formula p = 1 - fcdf(F, 1, DoF), where the fcdf function calculates the lower tail of
the cumulative distribution function for the F-distribution with one and DoF degrees of freedom.

6. Holm-Bonferroni:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
The Holm-Bonferroni test sorts the p-values in ascending order and compares them to nominal significance levels from
α/k to α, namely the values: α/k, α/(k-1),...,α/2, α.
7. Holm-Sidak:
This test uses the statistic t = (mi - mj )/SEMij .
The probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1 - tcdf(t, DoF)] otherwise,
where the tcdf function calculates the lower tail of the cumulative distribution function for the Student’s t-distribution with
DoF degrees of freedom.
The Holm-Sidak test sorts the p-values in ascending order and compares them to nominal significance levels from 1 - (1 -
α)1/k to α, namely the values: 1 - (1 - α)1/k , 1 - (1 - α)1/(k-1) ,...,1 - (1 - α)1 .

When comparing the sample means (Interactions box checked) QtiPlot calculates the test statistics and the probabilities using
the formulas defined for the one-way ANOVA post-hoc tests.

5.36 Kruskal-Wallis ANOVA Dialog

This dialog is activated by selecting the Kruskal-Wallis ANOVA... command from the Statistics -> Nonparametric Tests ->
menu. It can be used in order to test whether several samples originate from the same distribution. QtiPlot uses the test procedure
explained in the following Wikipedia article
The QtiPlot Handbook 204 / 452

Figure 5.110: The Kruskal-Wallis ANOVA dialog.

QtiPlot computes the test statistic (H) and an approximated p-value. The approximation is based on the fact that when the size
of the input samples (Ni ) or the number of samples (k) is large (i.e. Ni > 5 or k ≥ 3), the probability distribution of H is that of a
chi-squared distribution whith k-1 degrees of freedom (DoF). The p-value computed by QtiPlot is the probability of a chi-squared
value of at least H being observed: 1-chi2cdf(H, k-1). The null hypothesis is rejected if the approximated probability is lower
than the value of the significance level.
The data sets selected in the Available data window can be added to the analysis either by pressing the left to right arrow button
or by dragging and dropping them onto the right side window.

5.37 Mood’s Median Test Dialog

This dialog is activated by selecting the Mood’s Median Test... command from the Statistics -> Nonparametric Tests -> menu. It
can be used in order to test whether several samples originate from the same distribution.
The QtiPlot Handbook 205 / 452

Figure 5.111: The Mood’s median test dialog.

QtiPlot combines the scores from the k input samples in the Selected Data box. These N values (N = n1 + n2 +...+ nk , where nj
are the individual sizes of each sample) are sorted and an overall median is calculated. Afterwards QtiPlot creates a frequency
table and displays the number of scores in each sample below (N1j ) and above (N2j ) the previousely calculated median, where R1
= N11 + N12 +...+ N1k , R2 = N21 + N22 +...+ N2k and j = 1, 2,...,k.
This test uses the Chi-Square statistic (χ 2 ) which is calculated using the following formula: χ 2 = ΣΣ(Nij -Eij )2 /Eij , where Eij =
Ri nj /N, j = 1, 2,...,k and i can be either 1 or 2.
QtiPlot computes an approximated p-value, which is the probability of a chi-squared value of at least χ 2 being observed: 1-
chi2cdf(χ 2 , k-1), where the chi2cdf function calculates the lower tail of the cumulative distribution function for the chi-squared
distribution. The null hypothesis is rejected if the approximated probability is lower than the value of the significance level.
The data sets selected in the Available data window can be added to the analysis either by pressing the left to right arrow button
or by dragging and dropping them onto the right side window.

5.38 Friedman ANOVA Dialog

This dialog is activated by selecting the Friedman ANOVA... command from the Statistics -> Nonparametric Tests -> menu.
It can be used in order to test whether several samples originate from the same distribution. QtiPlot uses the test procedure
explained in the following Wikipedia article.
The QtiPlot Handbook 206 / 452

Figure 5.112: The Friedman ANOVA dialog.

The Friedman test is only applicable to complete data blocks, missing values are not accepted, therefore you need to check that
the input data samples (table columns) have the same number of non-empty cells. The procedure involves ranking the scores in
each input column with respect to the corresponding observations from the same table row. Average ranks are assigned to tied
scores.
QtiPlot computes the test statistic (Q) and an approximated p-value. The approximation is based on the fact that when the size of
the input samples (n) or the number of samples (k) is large (i.e. n > 15 or k > 4), the probability distribution of Q is that of a chi-
squared distribution whith k-1 degrees of freedom (DoF). The p-value computed by QtiPlot is the probability of a chi-squared
value of at least Q being observed: 1-chi2cdf(Q, k-1), where the chi2cdf function calculates the lower tail of the cumulative
distribution function for the chi-squared distribution. The null hypothesis is rejected if the approximated probability is lower
than the value of the significance level.
The data sets selected in the Available data window can be added to the analysis either by pressing the left to right arrow button
or by dragging and dropping them onto the right side window.

5.39 One Sample Wilcoxon Signed Rank Test Dialog

This dialog is activated by selecting the One Sample Wilcoxon Signed Rank Test... command from the Statistics -> Nonparamet-
ric Tests -> menu. It can be used as a non-parametric alternative to a one-sample t-test. The test determines whether the median
of the data sample is equal to a specific value.
The QtiPlot Handbook 207 / 452

Figure 5.113: The one sample Wilcoxon signed rank test dialog.

QtiPlot computes the test statistic, W, and a Z-score. If the reduced sample size, Nr , after excluding the ties, is more than 200,
QtiPlot uses the normal distribution approximation in order to calculate a p-value. Bellow this threshold QtiPlot also uses an
exact method to compute the statistic probabilities using a recursion equation explained by Jerome Klotz in his book from 2006,
A Computational Approach to Statistics, chapter 15.2, pages 297-299. The null hypothesis is rejected if the probability is lower
than the value of the significance level.
The Z-score is computed using the following formula: Z = [W-m-0.5*sign(W-m)]/[m(2Nr +1)/6]1/2 , where 0.5 is a continuity
correction factor and m = Nr (Nr +1)/4.

5.40 Sign Test Dialog

This dialog is activated by selecting the Paired Sample Sign Test... command from the Statistics -> Nonparametric Tests -> menu.
It can be used in order to test for consistent differences between pairs of observations. The Wikipedia article on the sign test
makes for excellent reading on this topic.
The QtiPlot Handbook 208 / 452

Figure 5.114: The paired sample sign test dialog.

For two paired samples, Xi and Yi , the test statistics (S) is the number of pairs for which Xi < Yi . QtiPlot also computes the
reduced sample size (Nr ), which is the number of non-tied paires (Xi ̸= Yi ) and a probability p.
For a lower tail test, the p-value is the probability of observing a value ≤ S, if S ≤ Nr /2, or of observing a value < S, if S > Nr /2
and is calculated using the cumulative distribution function of the binomial distribution: binocdf(S, Nr , 0.5). For an upper tailed
test, the probability is calculated as the complement of the lower tail probability: 1-p. For a two-tailed test, the probability is
calculated as the double of the lower of these two values: 2min(p, 1-p). The null hypothesis is rejected if the probability is lower
than the value of the significance level.
If Nr > 25, QtiPlot also computes a Z-score, using the following formula: Z = [S-m-0.5sign(S-m)]/Var1/2 , where 0.5 is a continuity
correction factor, m = Nr p is the mean of the binomial distribution with probability p and its variance is Var = Nr p(1-p). In our
case positive and negative differences are equally probable for the paired samples, therefore p is 0.5.
If there are missing values in the two source data columns, the whole pair will be excluded from the analysis.

5.41 Paired Sample Wilcoxon Signed Rank Test Dialog

This dialog is activated by selecting the Paired Sample Wilcoxon Signed Rank Test... command from the Statistics -> Nonpara-
metric Tests -> menu. It can be used in order to determine whether two dependent samples were selected from populations having
the same distribution. The test procedure is explained in a Wikipedia article. If the reduced sample size, Nr , after excluding the
ties, is more than 200, QtiPlot uses the normal distribution approximation in order to calculate a p-value and to take the decision
of rejecting or not the null hypothesis. Bellow this threshold QtiPlot also uses an exact method to compute the p-values using the
algorithm explained by Stenver Jerkku in his Bachelor’s thesis, Parallel Wilcoxon signed-rank tests, 2014, University of Tartu,
Institute of Computer Science, chapter 2.7.2, page 18. The null hypothesis is rejected if the probability is lower than the value of
the significance level.
The QtiPlot Handbook 209 / 452

Figure 5.115: The paired sample Wilcoxon signed rank test dialog.

QtiPlot also computes the test statistic, W, and a Z-score, using the formula: Z = [W-0.5sign(W)]/Var1/2 , where 0.5 is a continuity
correction factor and the variance is Var = Nr (Nr + 1)(2*Nr + 1)/6.
If there are missing values in any of the paired source data columns, the whole pair will be excluded from the analysis.

5.42 Two Sample Kolmogorov-Smirnov Test Dialog

This dialog is activated by selecting the Kolmogorov-Smirnov Test... command from the Statistics -> Nonparametric Tests ->
menu. It can be used in order to estimate the statistical likelihood that two samples are drawn from the same distribution. The
Wikipedia article on the Kolmogorov-Smirnov test makes for excellent reading on this topic.
The QtiPlot Handbook 210 / 452

Figure 5.116: The two sample Kolmogorov-Smirnov test dialog.

5.43 Mann-Whitney Test Dialog

This dialog is activated by selecting the Mann-Whitney Test... command from the Statistics -> Nonparametric Tests -> menu. It
can be used in order to determine whether two independent samples were selected from populations having the same distribution.
The Wikipedia article on the Mann-Whitney U test makes for excellent reading on this topic.

Figure 5.117: The two sample Mann-Whitney test dialog.

Let us consider two independent samples of size n1 and n2 respectively. The test procedure includes the following steps:
The QtiPlot Handbook 211 / 452

1. Combine the two samples in a group.


2. Rank them in ascending order, beginning with 1 for the smallest value. Where there are groups of tied values, assign a rank
equal to the average of unadjusted rankings.
3. Add up the ranks for the observations which came from the first sample (R1 ). The sum of ranks in the second sample, R2 , can
now be calculated, since the sum of all the ranks equals N(N+1)/2, N being the total number of observations: N = n1 +n2 .
4. Calculate U1 = R1 -n1 (n1 +1)/2 and U2 = R2 -n2 (n2 +1)/2. The test statistic U is the smaller value of U1 and U2 .
5. Calculate the approximate normal test statistic Z = [U-m-0.5(U-m)]/Var1/2 , where 0.5 is a continuity correction factor, m =
n1 n2 /2 is the mean and the variance Var = m(N+1)/6, in the absence of ties.
6. If there are ties in ranks, the following correction value is substracted from the variance: mT/[N(N-1)], where T can be
calculated by summing the values tj (tj -1)(tj +1)/6 for each group of ties, tj being the number of ties in the j-th group.
7. Calculate a p-value for the approximate normal test statistic Z. The null hypothesis is rejected if the probability is lower than
the value of the significance level.

5.44 Baseline Dialog

This dialog is activated by selecting the Subtract -> Baseline command from the Analysis menu. With its help it is possible to
create and subtract a baseline from your data curves.
By pressing the Create Baseline button the number of baseline anchor points specified using the Points box are generated auto-
matically or manually and then connected with an interpolation curve or with a custom function. The automatically generated
anchor points are equally spaced.
The Method list box allows to select one of the three methods available for the creation of the anchor points of the baseline curve:

1) Interpolation: Curve data points are interpolated using either Linear, Cubic or Non-rounded Akima interpolation.

2) User Defined Equation: The anchor points are calculated using a custom analystical function Y = f(x).

3) Existing Dataset: Finally if you already have the coordinates of the baseline anchor points you can use them by indicating
the table column where the dataset is stored.
The QtiPlot Handbook 212 / 452

After the creation of the baseline you can modify the position of the anchor points by pressing the Modify button. You can set the
new positions by simple drag-and-drop using the mouse pointer. Precise positioning of the anchor points can be achieved using
the arrow keys (Left and Right arrows change the point to modify Up and Down arrow keys move vertically the point). It is also
possible to use the numeric keypad which define a sort of compass rose:

1. 8-key: North
2. 9-key: North-East
3. 6-key: East
4. 3-key: South-East
5. 2-key: South
6. 1-key: South-West
7. 4-key: West
8. 7-key: North-West

Finally by pressing the Subtract button the baseline data is subtracted from your spectrum. This operation can be undone using
the Undo Subtraction button.

5.45 Math on Data Sets Dialog

This dialog is activated by selecting the Subtract -> Reference Data command or the Math on Data Sets... command from the
Analysis menu. With its help it is possible to perform basic mathematical operations (additions, substractions, divisions and
multiplications) on data curves.

Figure 5.118: The Math on Data Sets dialog.

By pressing the Apply button, the arithmetic operation selected in the Operator list box is applied to the current data Curve and to
a second operand that can be either an existing data set (a Table column) or a custom Value entered by the user. The last operation
can be reverted by pressing the Undo button.
If the second operand is a table column QtiPlot might also use a linear interpolation on the values of this column and the abscissas
of the data curve to be modified before performing the requested arithmetic operation.
By checking the Current folder option, only the tables in the active folder of the project are displayed in the Data set list box.

5.46 Average Multiple Curves Dialog

This dialog is activated by selecting the Average Multiple Curves... command from the Analysis menu.
The table at the top of the dialog displays all the curves available in the active plot layer and their X data range. It allows users
to select the curves to be averaged, by checking the corresponding box from the Use column.
The QtiPlot Handbook 213 / 452

Figure 5.119: The Average Multiple Curves dialog.

The Averaged X list box can be used in order to specify how X values will be computed for the averaged output curve. There are
four methods available:

1. Same as Curve: uses the X values of the data curve selected in the list box bellow. For the selected curve, the exact Y
values are used when calculating the average. For all other datasets the Y values are interpolated.
2. Common X Range: generates a set of equally spaced X values from the largest minimum X to the smallest maximum X
and calculates the average of all interpolated Y.
3. Full X Range: generates a set of equally spaced X values from the smallest minimum X to the largest maximum X and
calculates the average of all interpolated Y.
4. Custom: generates a set of equally spaced values within the specified X range and calculates the average of all interpolated
Y.

The X Minimun box displays the lower limit of the X range for the averaged curve. It can be edited only when the method
selected in the Averaged X list box is Custom, otherwise it is read-only.
The X Maximum box displays the upper limit of the X range for the averaged curve. It can be edited only when the method
selected in the Averaged X list box is Custom, otherwise it is read-only.
The Interpolate list box can be used to control the interpolation method. Three methods are available: Linear, Cubic and Non-
rounded Akima. Please note that each of these methods require a minimum number of data points in the input curves which is 2,
3 and 5 respectively.
The Points box is read-only if the method selected in the Averaged X list box is Same as Curve. Otherwise it can be used to
specify the number of points for the interpolated curves.
The Color box can be used to specify the color of the output curve.
If the Delete average curves button is pressed all output curves generated during the current session of the dialog are deleted.

5.47 Intersections Dialog

This dialog is activated by selecting the Intersections... command from the Analysis menu.

5.47.1 Rectangle Tab

When the dialog is opened, it adds a yellow rectangle to the active plot layer. This rectangle defines the region where to search
for the intresections between curves. The Rectangle tab of the dialog allows to customize the coordinates of this region of interest
and its background color.
The QtiPlot Handbook 214 / 452

Figure 5.120: The Intersections Dialog: Rectangle tab

5.47.2 Options Tab

The controls in the Symbol group box of this tab can be used in order to define the style, size and and color of the data symbols
used to visualize the intersections between curves.
It is also possible to customize the Labels for each intersection point and to choose the Interpolation method and the number of
sampling Points.

Figure 5.121: The Intersections Dialog: Options tab.

5.47.3 Custom Output Tab

The Table button, when pressed, activates the results table. The user may type the name of the result table in the edit box. Please
beware that if the name corresponds to an existing table, the contents of that table will be altered.
The QtiPlot Handbook 215 / 452

Figure 5.122: The Intersections Dialog: Custom Output tab.

5.48 Integration Options

This dialog box is opened when you select the Integrate... command from the Analysis menu. The dialog displays a different set
of controls depending if you are integrating data from a table or from a plot curve.

Figure 5.123: The Integration Options dialog box for curves.


The QtiPlot Handbook 216 / 452

Figure 5.124: The Integration Options dialog box for tables.

Pressing the Integrate button performs a numerical integration using the trapezoidal method. The result of the integration is listed
in the Log Panel.
If the Sort data option is checked the data is sorted before performing the integration with respect to the X values associated to
the input columns or to the abscissas of the curve to be integrated. This option is not available if the input data columns come
from a table window without any designated X column. In this case the input data is assigned by default with ascending X values.
By checking the Show plot option a new graph window will be created containing a plot of the integrated curve, the data for
which is stored in a new (hidden) table. QtiPlot stores the integration operation into this output graph window if the Recalculate
option is other than No. By setting this option to Auto any modification of the input data will trigger a recalculation of the value
of the integral.

5.49 Integrate Function Dialog

This dialog box is opened when you select the Integrate Function... command from the Analysis menu.

Figure 5.125: The Integrate Function... dialog box.

Pressing the Integrate button performs a numerical integration of a user defined analytical function. This function can be en-
tered/edited in the Function text box. The numerical result of the integration is displayed in the Log Panel.
The Σ button pops-up a menu listing all built-in mathematical functions provided by QtiPlot. Pressing one of the actions from
this menu copies the displayed function into the edit box at the position of the text cursor.
The QtiPlot Handbook 217 / 452

Clicking on the button displaying a pencil icon opens a menu which lists recently used functions. By pressing one of the menu
items, the selected function is inserted into the edit text box at the current position of the cursor.

Clicking the Clear button removes the contents of the Function text box.
The Variable input field displays the name of the independent variable of the function (i.e., the variable of integration). By default
it is set to x.
The third input parameter is the maximum number of Subintervals that the integration algorithm may use to integrate the function.
The default value of 1000 should work in almost all circumstances.
The fourth parameter is the Tolerance limit. Smaller numbers will result in the algorithm using more subintervals. The default
value of 0.01 should work for most functions.
The next two fields are the lower and upper limits of integration. Set these to whatever values you need.
The Plot Area option should be checked if you want that QtiPlot draws a plot of the integrated function on the currently active
layer. A table of the plotted data can be generated by right clicking on the curve and selecting the Worksheet command.

5.50 Linear Fit Options

This dialog box is opened when you select the Fit Linear... command from the Analysis -> Fitting menu. It allows to choose the
curve to fit, the number of data points for the resulting curve, the abscissa limits for the fit and the weighting method.

Figure 5.126: The Linear Fit Options dialog box.

The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.
3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
The Scale Errors with sqrt(Chiˆ2/doF) option becomes available only if the weighting method is set to something else than No
weighting. This option only affects the errors on the parameters reported after the fit operation. It does not affect the fitting
process or the data in any way. If checked, the reported errors on the parameters are calculated as the square root of the diagonal
elements of the covariance matrix multiplied with sqrt(Chi2 /(n - p)), where n is the number of data points and p the number of fit
parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the covariance matrix.
The QtiPlot Handbook 218 / 452

It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.
Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
If the Apparent Fit option is checked, QtiPlot uses the apparent values for fitting, according to the current axis scales. For
example, select this box to fit exponentially decaying data with a straight line fit when data are plotted on a log scale. When this
check box is selected and the data has error values associated with it, QtiPlot uses the larger of the positive/negative errors as
weight. Apparent Fit is only useful when you fit from a graph and change the plot axis type (from Linear to Log10, for example).
If you check this option, QtiPlot will first transform raw data into new data space as specified in the graph axis type, and then fit
the curve with the new data. Otherwise, QtiPlot always fits raw data directly, regardless of the axis type. Apparent fit is equivalent
to direct fit if you first transform raw data on the worksheet, and leads to completely different results from direct fit if your graph
axis is non-linear.
If the option Through (0,0) is checked, QtiPlot uses the linear slope function y = A*x in order to perform the fit, instead of the
default equation (y = A*x + B). This is equivalent to forcing the fit line to pass through the point with coordinates (0,0).
The numerical result of the fit operation will be displayed in the Log Panel.

5.51 Polynomial Fit Options

This dialog box is opened when you select the Fit Polynomial... command from the Analysis -> Fitting menu. It allows to choose
the curve to fit, the order of the polynomial function to use, the number of points of the resulting curve, the abscissa limits for
the fit and the weighting method.

Figure 5.127: The Polynomial Fit Options dialog box.

The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.
3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
The QtiPlot Handbook 219 / 452

4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
The Scale Errors with sqrt(Chiˆ2/doF) option becomes available only if the weighting method is set to something else than No
weighting. This option only affects the errors on the parameters reported after the fit operation. It does not affect the fitting
process or the data in any way. If checked, the reported errors on the parameters are calculated as the square root of the diagonal
elements of the covariance matrix multiplied with sqrt(Chi2 /(n - p)), where n is the number of data points and p the number of fit
parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the covariance matrix.
It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.
Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
If the Apparent Fit option is checked, QtiPlot uses the apparent values for fitting, according to the current axis scales. For
example, select this box to fit exponentially decaying data with a straight line fit when data are plotted on a log scale. When this
check box is selected and the data has error values associated with it, QtiPlot uses the larger of the positive/negative errors as
weight. Apparent Fit is only useful when you fit from a graph and change the plot axis type (from Linear to Log10, for example).
If you check this option, QtiPlot will first transform raw data into new data space as specified in the graph axis type, and then fit
the curve with the new data. Otherwise, QtiPlot always fits raw data directly, regardless of the axis type. Apparent fit is equivalent
to direct fit if you first transform raw data on the worksheet, and leads to completely different results from direct fit if your graph
axis is non-linear.
The numerical result of the polynomial fit operation will be listed in the Log Panel. If the option Show Formula on Graph? is
checked the result will also be displayed in the output graph window under the form of a new text legend.

5.52 Multiple Linear Regression Dialog

This dialog box is opened when you select the Multiple Linear Regression... command from the Analysis -> Fitting menu. It
allows to choose the dependent and independent data and the weighting method and to customize the output of the analysis.
For more details about the algorithm used in QtiPlot please visit the Multiple Linear Regression Model section from the chapter
dedicated to the Analysis of data and curves.
The QtiPlot Handbook 220 / 452

Figure 5.128: The Multiple Linear Regression dialog box.

The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must define Y error bar columns to the analyzed table before performing the fit.
3. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the dependent data set.

If the source data table contains Y error bar columns the weighting method is automatically set to Instrumental and a list box
displays the names of the available Y error bar columns.
The Scale Errors with sqrt(Chiˆ2/doF) option becomes available only if the weighting method is set to something else than No
weighting. This option only affects the errors on the parameters reported after the fit operation. It does not affect the fitting
process or the data in any way. If checked, the reported errors on the parameters are calculated as the square root of the diagonal
elements of the covariance matrix multiplied with sqrt(Chi2 /(n - p)), where n is the number of data points and p the number of fit
parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the covariance matrix.
The numerical results of the fit operation will be displayed in the Log Panel if you check the output option Write Parameters to
Result Log and/or in a new table if the option Parameters Table is checked. It is also possible to generate a Covariance Matrix
window after each linear regression operation performed.
The options in the Plot group box can be used to specify the plot curves to be generated after each fit operation. If the Dependent
Data/Index option is checked QtiPlot generates a scatter plot of the dependent data versus the data index (order of the data points).
If the Dependent Data/Independent Data option is checked QtiPlot also generates a panel plot of the dependent data and of the
predicted regression results with respect to each independent variable.
By default QtiPlot can generate three types of plots allowing to visualize the fit residuals. The residuals are calculated as the
difference between the experimental Yi values and the response values predicted by the Multiple Linear Regression Model.
If the Residuals Plot/Index option is checked QtiPlot generates a scatter plot of the fit residuals versus the data index (order of the
data points). If the Residuals Plot/Independent Data option is checked QtiPlot also generates a panel graphs window displaying
the scatter plot of the fit residuals with respect to each independent variable. If the Histogram of Residuals option is checked
QtiPlot creates a plot window displaying the histogram of the residuals.

5.53 Fit Exponential Decay - First Order

This dialog box is opened when you select the Fit Exponential Decay -> First Order... command from the Analysis -> Fitting
menu. It allows to choose the curve to fit, the initial guesses for the fit parameters and the weighting method.
The QtiPlot Handbook 221 / 452

Figure 5.129: The Fit Exponential Decay options dialog box.

The exponential decay fit uses the following equation:


y = Y0 + Ae(-x/t)
where Y0 corresponds to the Y Offset, A is the Amplitude and t the Decay time.
The Initial time represents the left abscissa limit for the fit data. QtiPlot guesses initial values for these parameters upon selection
of the curve to fit, but it might be necessary to modify them in order for the fit to converge.
The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.
3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.

4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
The Scale Errors with sqrt(Chiˆ2/doF) option only affects the errors on the parameters reported after the fit operation. It does not
affect the fitting process or the data in any way. If checked, the reported errors on the parameters are calculated as the square root
of the diagonal elements of the covariance matrix multiplied with sqrt(Chi2 /(n - p)), where n is the number of data points and
p the number of fit parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the covariance
matrix.
It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.
Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
The QtiPlot Handbook 222 / 452

5.54 Fit Exponential Decay - Second Order

This dialog box is opened when you select the Fit Exponential Decay -> Second Order... command from the Analysis -> Fitting
menu. It allows to choose the curve to fit, the initial guesses for the fit parameters and the weighting method.

Figure 5.130: The Fit Exponential Decay Second Order dialog box.

The two exponentials decay fit uses the following equation:


y = Y0 + A1 e(-x/t1) + A2 e(-x/t2)
where Y0 corresponds to the Y Offset, t1 is the First decay time and t2 the Second decay time.
The Initial time represents the left abscissa limit for the fit data. QtiPlot guesses initial values for these parameters upon selection
of the curve to fit, but it might be necessary to modify them in order for the fit to converge.
The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.

3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.

Auto - A recalculation is automatically performed when input data changes.


Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
The QtiPlot Handbook 223 / 452

5.55 Fit Exponential Decay - Third Order

This dialog box is opened when you select the Fit Exponential Decay -> Third Order... command from the Analysis -> Fitting
menu. It allows to choose the curve to fit, the initial guesses for the fit parameters and the weighting method.

Figure 5.131: The Fit Exponential Decay Third Order dialog box.

The three exponentials decay fit uses the following equation:


y = Y0 + A1 e(-x/t1 ) + A2 e(-x/t2) + A3 e(-x/t3)
where Y0 corresponds to the Y Offset, t1 is the First decay time, t2 is the Second decay time and t3 the Third decay time.
The Initial time represents the left abscissa limit for the fit data. QtiPlot guesses initial values for these parameters upon selection
of the curve to fit, but it might be necessary to modify them in order for the fit to converge.
The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.
3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.
Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
The QtiPlot Handbook 224 / 452

5.56 Fit Exponential Growth Dialog

This dialog box is opened when you select the Fit Exponential Growth... command from the Analysis -> Fitting menu. It allows
to choose the curve to fit, the initial guesses for the fit parameters and the weighting method.

Figure 5.132: The Fit Exponential Growth options dialog box.

The exponential growth fit uses the following equation:


y = Y0 + Ae(x/t)
where Y0 corresponds to the Y Offset, A is the Amplitude and t the Growth time.
The Initial time represents the left abscissa limit for the fit data. QtiPlot guesses initial values for these parameters upon selection
of the curve to fit, but it might be necessary to modify them in order for the fit to converge.
The available weighting methods are:

1. No weighting: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.

3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
4. Direct Weighting: the weighting coefficients are calculated as wi = yi , where yi are the y values in the fitted data set.

If the curve selected for the data fit operation has error bars attached, the weighting method is automatically set to Instrumental
and a list box displays the names of the available error bar curves.
It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.

Auto - A recalculation is automatically performed when input data changes.


Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
The QtiPlot Handbook 225 / 452

5.57 The Fit Wizard

This dialog is activated by selecting the command Fit Wizard... from the Fitting -> Analysis menu. This command is active if
a plot or a table window is selected. In the latter case, this command first creates a new plot window using the list of selected
columns in the table.
This dialog is used to fit discrete data points with a mathematical function. The fitting is done by minimizing the least square
difference between the data points and the Y values of the function, see the Data Fitting section of the Analysis chapter for more
details.

5.57.1 Select Function Tab

The top of the dialog box is used to select one of the four Categories of functions:

User defined: functions which have been previously edited and saved by the user.
Built-in: the fit models provided by QtiPlot in the from the Fitting -> Analysis menu.
Basic: simple elementary functions.

Plugins: external functions provided via plugins.

To choose a function, first select a category and then the desired function from the displayed Function list.
If the selected function is from the Built-in category and you wish to perform the fit operation using the selected built-in model,
you must check the option Fit using built-in function. This will clear the contents of the edit text pane (see image below) and
copy the selected function into it.
If the selected built-in model is one of the following peak shape functions: Gauss, Lorentz, PsdVoigt1 or PsdVoigt2, the Peaks
input box becomes available, allowing to choose the number of individual peaks for a multi-peak fit operation.
When the selected built-in model is the Polynomial function the Polynomial order input box becomes available, allowing to
choose the order of the polynomial fit function.
If you wish to define your own fit model, the Fit using built-in function option should be unchecked. In this case you can also
click the Add expression button to copy the selected function, but this will not clear any previous contents from the edit text pane.
If you’ve selected one of the Basic functions, there are no checkboxes/options available and you need to use the Add expression
button.
The bottom half of the dialog box allows you to define your own function. You can either write you own mathematical expres-
sion from scratch or add expressions from the function selector with the Add expression button. Once a custom expression is
completed, clicking on the Save button will add the function to the list of user defined functions. The Name field will be used
as the name of the function. A copy of the function is saved on disk with the extension ".fit". You can define the folder where
".fit" files are saved using either the Choose models folder... button (shown only when "User defined" is selected) or by selecting
a new folder in the Save file dialog. Functions can be removed from the User Defined list by selecting them and clicking on the
Remove button. You will be asked to confirm the deletion.
The QtiPlot Handbook 226 / 452

This first step is used to define the function which will be used for fitting. When you are ready to perform the fit, click on the

button to activate the Fitting Session.

Figure 5.133: The first step of the Fit Wizard... dialog box.

5.57.2 Fitting Session Tab

In this second step the parameters of the fit must be defined. A starting point must be provided for the fitting parameters usig the
Initial guesses tab.

Figure 5.134: The Fit Wizard... dialog box: providing initial guesses for the fit parameters.
The QtiPlot Handbook 227 / 452

In the Data Set tab you can choose the input data set(s) and also choose a weighting method for your fit (the default is No
weighting). The available weighting methods are:

1. No weight: all weighting coefficients are set to 1 (wi = 1).


2. Instrumental: the values of the associated error bars are used as weighting coefficients wi = 1/eri 2 , where eri are the error
bar sizes stored in error bar columns. You must add error bars to the analyzed curve before performing the fit.

3. Statistical: the weighting coefficients are calculated as wi = 1/yi , where yi are the y values in the fitted data set.
4. Arbitrary Dataset: allows setting the weighting coefficients using an arbitrary data set wi = 1/ci 2 , where ci are the values
in the arbitrary data set. The column used for the weighting must have a number of rows equal to the number of points in
the fitted curve.

5. Direct Weighting: allows setting the weighting coefficients using an arbitrary data set wi = ci , where ci are the values in
the arbitrary data set. The column used for the weighting must have a number of rows equal to the number of points in the
fitted curve.

Figure 5.135: The Fit Wizard... dialog box: choosing the input data set(s).

It is also possible to specify how the fit operation responds to modifications of the source data curve using the Recalculate list
box. The available options are:

No - No recalculation when data changes, the fit object is deleted from memory when the operation ends.
Auto - A recalculation is automatically performed when input data changes.
Manual - No recalculation is triggered when data changes, instead you can perform a recalculation at any time by pressing the
Recalculate button from the Analysis tab of the plot details dialog.

The recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
The QtiPlot Handbook 228 / 452

Figure 5.136: The Fit Wizard... dialog box: choosing the fit algorithm.

5.57.3 Custom Output Tab

Depending on the settings in the Custom Output tab, a function curve (option Uniform X Function) or a new table (if you choose
the option Same X as Fitting Data) will be created for each fit. The new table includes all the X and Y values used to compute
and to plot the fitted function and is hidden by default. It can be found in and viewed from the project explorer.
After the fit, if the Write Parameters to Result Log box from the Options group is checked, the log window is opened to show the
results of the fitting process.
The QtiPlot Handbook 229 / 452

This third step is used to customize the output of a fitting operation.

Figure 5.137: The third step of the Fit Wizard... dialog box.

The options in the Curves group box can be used to specify if some additional plot curves should be generated after each fit
operation. If the Conf. Bands and Pred. Bands options are checked QtiPlot generates confidence bands and prediction bands for
the current fit, based on the user defined value for the confidence level. If the Residuals Plot option is checked the curve of the
fit residuals is also displayed. The residuals are calculated as the difference between the experimental Yi values and the response
values predicted by the fit model.
The controls in the Parameters Output group box can be used in order to define the options for the display of the results from data
fit operations. The Format list box allows to choose a default numerical format. The value of the Significant Digits option can
be used to customize the precision of the output and has a different meaning depending on the numeric format. The following
format and precision options are available:

Default - Decimal or scientific e-notation, whichever is the most concise. The value of the Significant Digits control represents
the maximum number of significant figures in the output (trailing zeroes are omitted).
Decimal: 1000 - Decimal notation. The value of the Significant Digits control represents the number of digits after the decimal
point.
Scientific: 1E3 - Scientific e-notation where the letter e is used to represent "times ten raised to the power of" and is followed
by the value of the exponent. The value of the Significant Digits control represents the number of digits after the decimal
point.

5.57.3.1 Reported errors

The errors on the fit parameters are displayed in the log window only if the Error box from the Results Log group is checked.
The Scale Errors with sqrt(Chiˆ2/doF) option only affects the errors on the parameters reported after the fit operation. It does not
affect the fitting process or the data in any way. If checked, the reported errors on the parameters, ε j , are calculated as the square
root of the diagonal elements of the covariance matrix Cov(j, j) multiplied with sqrt(Chi2 /(n - p)), where n is the number of data
points and p the number of fit parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the
covariance matrix Cov(j, j).
If the LCL and UCL options from the Results Log group box are checked QtiPlot also displays the confidence limits for each fit
parameter based on the value of the confidence level specified in the Curves box.
The QtiPlot Handbook 230 / 452

5.57.3.2 Goodness-of-Fit Statistics

After the fit, a series of statistics are displayed in the log window allowing evaluation of the goodness of fit. The controls in the
Statistics group box can be used to specify which of these fit statistics should be displayed by default. For more details about
these values please visit the Data fiting section from the chapter dedicated to the Analysis of data and curves.

5.58 Help Window

This window is activated by selecting the Help command from the Help menu. Starting with release 1.1 of QtiPlot, the help
window replaces the browser based on Qt Assistant. It is a lightweight solution providing almost the same functionality through
its Contents and Search side panels and its Help and Find toolbars placed by default at the top of the window. The toolbars can
be moved with the mouse and docked in a more convenient location (left, right or bottom sides of the window).
The Contents panel is located by default on the left side of the window and can be shown or hidden using the corresponding
Contents (Alt-C) toggle action from the View menu. It displays a tree view of all the help sections and subsections that are
indexed in the QtiPlot user manual. A click on a tree item in this panel displays the corresponding help page.
The Search panel, also located by default on the left side of the window, just bellow the Contents panel, can be shown or hidden
using the Search (Ctrl-S) toggle action from the View menu. It allows to perform a search through all the QtiPlot user manual,
contrary to the Find toolbar that allows searching a text only in the currently displayed page. The Find toolbar can be shown or
hidden using the corresponding Find (Ctrl-Alt-F) toggle action from the View -> Toolbars menu.
The Help toolbar can be shown or hidden using the corresponding Help (Alt-T) toggle action from the View -> Toolbars menu.
It displays the history browsing actions from the View menu, Previous (Ctrl-[) and Next (Ctrl-]), the Home (Alt-H) action and
two zooming actions: Zoom In (Ctrl-+) and Zoom Out (Ctrl--). It also displays the Copy Selection (Ctrl-C) action from the Edit
menu and the toggle action for the Find toolbar.

Figure 5.138: Help browser window.

5.59 General Plot Options

5.59.1 Scale Tab

The first tab is used to set the general scales used for two or three axis plots.
The QtiPlot Handbook 231 / 452

Figure 5.139: General plot options dialog: The Scale Tab.

In this tab, you can set the number of ticks used for each axis. This can be done in two ways: 1) Set the number of labels to use
for the entire scale. Whatever number you enter, QtiPlot may adjust the value so as to produce a prettier plot (for example, if
you enter 7 ticks for a 0..100 scale, QtiPlot will use 10 major ticks spaced evenly from 10 to 100). 2) Set the Step Increment and
QtiPlot will generate as many ticks as needed to fill the scale range using the indicated increment. This produces tick spacings
and labels which are more like those that are typically done on hand drawn graphs.
Please note that the number of major ticks cannot exceed the Max Number value defined in the 2D Plots -> Ticks tab of the
Preferences dialog. In case you need to display more tick labels (or equivalently use a smaller step size) than allowed by this
default limit, you must modify it first.

5.59.2 Grid Tab

The grid tab is used to draw grid lines on the plot. The frequency of the lines are related to the number of labels and major ticks
set with the Scale tab.
The QtiPlot Handbook 232 / 452

Figure 5.140: General plot options dialog: The Grid Tab.

5.59.3 Axis Tab

The third tab is used to modify the setting of the different axes. You must select the axis to be customized in the right window.
The label of that axis can then be modified in the title window - see the text options dialog section for more details.
The QtiPlot Handbook 233 / 452

Figure 5.141: General plot options dialog: The Axis Tab.

5.59.4 Special Ticks Tab

The Special Ticks tab is used to customize the major tick labels for the different axes. You must select the axis to be customized
from the list on the right side of the dialog window. The positions of the ticks are displayed in the first column of the table. These
positions cannot be modified, editing being disabled for all cells in this column.
It is possible to customize the default labels displayed in the second column of the table as <auto>. In order to finish editing a
tick label you need to press the Return or Enter keys or the Apply button. Editing is also considered finished and the modifications
are applied when you change the active cell of the table, either with the mouse or by pressing the Tab key. Empty tick labels are
not accepted and are automatically replaced with the default value.
You can define custom colors for each tick label by pressing the corresponding push button in the third column of the table. This
will pop-up a color selection dialog.
The tick labels can be shown or hidden by checking or unchecking the corresponding box from the last column. Hidden tick
labels cannot be edited. The visibility of the first and last axis tick labels can also be controlled via the Hide Ticks list box in
the Axis tab. If these labels were already hidden by the user - this option was set to At Axis Begin, At Axis End or At Axis Begin
& End - the check boxes corresponding to these labels in the ticks table are disabled and the text Automatic is displayed next to
them.
The QtiPlot Handbook 234 / 452

Figure 5.142: General plot options dialog: The Special Ticks Tab.

5.59.5 General Tab

The General settings tab is used to customize global aspects of the plot. The canvas is the drawing area of the 2D plot layer that
is bounded by the four side axes. It is possible to draw a frame around the canvas and define its color and thickness using the
controls in the Canvas frame box.
The visibility of the backbone line for all side axes can be controled with a single click with the help of the Draw backbones
check box. Please beware that having both the Canvas frame and the Draw backbones options enabled simultaneously results in
a frame width larger than the value specified by the Thickness spin box.
The controls in the Axes group box allow to modify the lengths of the major and minor ticks for all layer axes. You can also
define a maximum number of major ticks using the Max Number spin box. The value of this parameter becomes the maximum
limit for the Major Ticks value in the Scale tab of this dialog
The QtiPlot Handbook 235 / 452

Figure 5.143: General plot options dialog: General Settings.

The Display list box can be used in order to quickly customize the layout of the axes. There are four predefined axes layouts
available:

Sides It is the classical layout, the axes are displayed alongside the canvas drawing area.
Crossing Axes Layout Two crossing axes, one vertical and one horizontal, are drawn inside the layer canvas. Their positions
can be customized using the Horizontal and Vertical input boxes as percentages of the canvas size.

Bottom + Vertical Two axes are displayed: the bottom axis and a vertical axis inside the layer canvas. The position of the
vertical axis can be customized using the Vertical input box as a percentage of the length of the bottom axis.
Left + Horizontal Two axes are displayed: the left axis and a horizontal axis inside the layer canvas. The position of the
horizontal axis can be customized using the Horizontal input box as a percentage of the length of the left axis.

5.60 The Plot Wizard

This dialog is activated by selecting the command Plot Wizard from the Plot Menu or with the Ctrl-Alt-W key. This command is
always active.
This dialog is used to build a new plot by selecting the columns from the tables available in the current project. First, select the
table you want to use from the Table combo box at the top of the dialog. If the selected table has a non-empty label, the label is
displayed bellow. Next, you must click on the New curve button to create a curve definition. After that, select at least one column
for X and one for Y using the <->X and <->Y buttons. You can also select columns for Z, X-errors and/or Y-errors using the
buttons provided for these options.
The curve definitions can be edited manually after double-clicking on them. For a faster editing process it is also possible to
clone the selected curve definition by pressing the Dupplicate button.
The plot will be created using the default style defined using the ’2D Plots -> Curves’ tab in the Preferences dialog.
The QtiPlot Handbook 236 / 452

In this example, one curve is selected from the first table, and the other from the second table (with X error bars)

Figure 5.144: The plot wizard dialog box.

5.61 Project Explorer Find Dialog

The project explorer find dialog is activated using a right-click on a folder item in the project explorer and selecting Find... or
selecting the command Find... from the Windows Menu. It permits searching a window anywhere in the project. It is possible to
perform a search in windows or table columns metadata (name, label and comments) or in other specific elements like data cells,
text objects on graphs or content of note windows.
The QtiPlot Handbook 237 / 452

Figure 5.145: The project explorer find dialog.

When the Find button is pressed and the search is proceeding, the button becomes Cancel. If the Cancel button is pressed while
performing a search, the undergoing operation stops, the button becomes Find again and the partial search result is output in the
bottom table of this dialog.
If the Case Sensitive box is checked, the search will distinguish between uppercase and lowercase characters when searching the
string typed in the Find... box. When the Whole Word option is selected, the search only looks for words that match completely
with the content specified in the Find... box. The Allow Wildcards parameter specifies whether or not the wildcards ? and * are
used in the Find... edit box: ? matches any single character and * matches zero or more of any characters. Please note that the
Whole Word and Allow Wildcards options cannot be checked simultaneously.
When the mouse is hovered over a row of the result table an information tooltip is displayed. If the row is double-clicked the
corresponding folder/window becomes active and the window is maximized.

5.62 Preferences Dialog

The preference dialog is used to customize the default behavior of QtiPlot. There are six pages of options which are selected
using one of icons from the column on the left hand side of the dialog. The text box at the top of the dialog shows the name of
the selected page. No matter which page is selected, there are always seven buttons along the bottom edge of the dialog: Help,
Default Options, Save As, Load Settings, Apply, OK and Cancel.
Changes must be confirmed using either the Apply or OK buttons. The OK button additionally closes the dialog. Upon confir-
mation, changes are saved and stored immediately. The Cancel button will not undo changes which have already been confirmed
but provides a means of exiting the dialog without confirming any changes that are pending. The Default Options button will
reset the values of all the settings to the program defaults.
The Help button opens the quick help window corresponding to the selected page.
Finally, the Save As... button opens a file save dialog allowing to export the user settings to a .ini or .txt file. Starting with version
0.9.9.6 user settings are saved to a file called QtiPlot.ini that is stored into a hidden subfolder called .qtiplot in the user’s home
directory. Therefore you can customise QtiPlot on any computer, export the settings file and load it on another computer by
pressing the Load Settings button or copy it manually to the .qtiplot subfolder of your home directory in order to get the same
behaviour of QtiPlot.
The QtiPlot Handbook 238 / 452

5.62.1 General Preferences

Selecting the General icon displays the General options page. The controls that control the general options are grouped onto
a set of seven tabs. Each tab references a set of related options.

5.62.1.1 Application Tab

Figure 5.146: The preferences dialog: general parameters for the application.

Controls on the Application tab are used to set application wide defaults.
The Language combo-box lists the translations available in QtiPlot. Select a language from this list. Control names, program
labels, etc., will be displayed in this language.
The Style combo-box defines the style used by QtiPlot for the window decorations. These include stylistic aspects of buttons,
dialog boxes, window borders and titles, etc. Available styles are those currently available in the Qt library.
The Font chooser selects the font used in the GUI (menus, dialogs, etc). It doesn’t apply to plots.
The Default Scripting Language combo-box is used to set the scripting language. muParser is the default. Python will also be
available if Python support has been compiled into QtiPlot.
The Undo Stack Size is the number of operations that can be undone/redone. By default it is set to ten operations. A high value
for this parameter can be very costly in terms of memory consumption, especially for large matrices.
The Endline character combo-box defines the end of line convention used by QtiPlot for copy/paste operations and for exporting
matrices/tables to ASCII files. The end of line convention can be set to any one of the following: Line Feed (LF), Carriage
Return + Line Feed (CRLF) or Carriage Return (CR) only.
The Start New Project combo-box is used to select what type of child window, if any, is created when a new project is started.
The default is for new projects to contain an empty Table window.
The Import Excel files using option allows to specify the method used by QtiPlot when trying to import Excel files. Depending
on the operating system QtiPlot provides four methods. The first one (the ExcelFormat library) can fail for certain files, therefore
The QtiPlot Handbook 239 / 452

QtiPlot provides a second solution which needs LibreOffice installed on your computer. The third solution which uses OpenOffice
is obsolete and users that employed it in older versions of QtiPlot are strongly encouraged to install LibreOffice since it is much
faster (the path to the soffice executable must be correctly set in the File Locations tab). Finally, on Windows platforms, if you
choose the option Locally installed Excel, QtiPlot uses Microsoft Excel as a server application in order to import the data sheets
and also the plots.
The Clipboard Image Format option allows to specify the method used by QtiPlot when copying plot images to clipboard.
When the first method (Bitmap) is chosen QtiPlot stores the plots as raster images, while the other methods use vectorial image
formats: Enhanced Metafile (.emf), the default format on Windows platforms, Encapsulated Postscript (.eps), the default on
Linux platforms and Scalable Vector Graphics (.svg).
The Preview check box allows to enable/disable the display of a preview image in the project explorer when the user hovers
the mouse over the name of a project window. The size of the preview can be customized using the spin box on the right. The
preview image is scaled to a rectangle preserving the aspect ratio of the window and having the shorter side equal to the value
displayed in the spin box. When the Preview box is not checked, the display of the preview image is disabled during mouse hover
events, but the user can still preview the window using the context menu of the window item. The context menu is displayed with
a right-click.
The Save Every check box is used to turn the auto-save feature on(checked) or off(unchecked). The associated textbox/spin
button is used to set the autosave interval. The interval is in minutes. The textbox only accepts positive integer numeric input.
All other input is ignored.
On macOS systems, starting with release 10.14 (Mojave), the Theme list box is available. It can be used in order to force the
usage of the Light or Dark theme, despite the settings in the general system preferences. If the selected theme is Auto, QtiPlot
honours the system preferences.
If the option Backup project before saving is checked, QtiPlot creates a backup copy of the current project before saving any
changes. This option is checked by default. The QtiPlot backup files have the extension *.qti~. If QtiPlot closes unexpectedly,
the current project file might be corrupted, but it is still possible to recover the initial state of the file which is stored in the .qti~
backup copy. This file can be opened using the Open command and selecting the option Backup files (*.qti~) from the list of
supported file types.
When checked, the Check for new versions at startup option will look for program updates on the internet each time the program
is started. The default is disabled.
When checked, the Open last project at startup option enables the feature that reloads the last active project when QtiPlot is
restarted. The default is enabled.
When checked, the Enable Autocompletion option enables the autocompletion feature of QtiPlot. Autocompletion is enabled by
default in all QtiPlot editors (Notes, Script Windows, and values dialogs for matrices and tables). Completion suggestions are
automatically popped-up for words that have more than two characters, but you can trigger autocompletion at any time using the
shortcut Ctrl+U. Autocompletion can be disabled by unchecking the Enable autocompletion option.
When the option Enable window changelog is checked, the information displayed in the undo/redo stack is logged internally for
each table or matrix window in the project and saved into the project file. This information can be viewed at any time by pressing
the Changelog... button in the Window Properties dialog of each table/matrix window.
The option Disable in-place editing has an effect when editing axis labels and texts from 2D/3D plot windows. When checked,
a local, in-place text editor is created after a double-click on the text to be edited, otherwise the editing process can only be
performed by opening the properties editor of each text object.
The option Enable high DPI scaling was introduced in release 1.1.3 and is disabled by default. It is useful when working with
multiple screens having different pixel densities. When this option is checked, the application window can be moved from a
high DPI screen lo a low DPI screen, or vice versa, and the user interface is automatically scaled based on the monitor’s pixel
density. This check box is not available on macOS computers because scaling is handled internally by the operating system.
After modifying this option QtiPlot needs to be manually closed and reopened before the change becomes effective.

5.62.1.2 Confirmations Tab

The General Preferences: Confirmations tab contains a set of check boxes that enable/disable various warning prompts. The first
six are warnings given when deleting folders or closing project windows (Tables, Matrices, 2D Plots, 3D Plots and Notes).
The QtiPlot Handbook 240 / 452

The remaining warnings are given when renaming or appending windows with names that are already used in the current project,
when pasting values to tables, when evaluating multi-line expressions using muParser, when attempting to overwrite an existing
file and when modifying data points using the 2D plot tools. All warnings are enabled by default.

Figure 5.147: The Preferences dialog: Confirmations tab.

5.62.1.3 Colors Tab

Using the controls from the General group box, it is possible to change the default color for the QtiPlot workspace, the panel
background color and the general color of the text. Panels refer for example to the Log Window or the Project explorer.
The controls from the Matrix group box can be used to change the default background and text colors for matrix windows.
The QtiPlot Handbook 241 / 452

Figure 5.148: The Preferences dialog: Colors tab.

5.62.1.4 Numeric Format Tab

The Numeric Format tab allows customizing several aspects of numeric formatting used by QtiPlot. The Number of Decimal Dig-
its specifies the default precision used for any calculations applied to your data in Tables and Matrices. The Decimal Separators
fields allow selection of the characters used as the decimal point and the thousands separator. By default, QtiPlot uses the locale
settings detected on your system. Separate fields are provided for data in tables/matrices and data copied to the clipboard. The
thousands separator can be eliminated completely from tables and matrices by checking the Omit Thousands Separator option.
QtiPlot will convert all the existing data in your project to the new settings when you click the Apply button.
If the option muParser uses C locale settings is checked operations like setting column/matrix values or plotting function curves
require that all the data input parameters are written using the standard convention for the C programming language: the decimal
point is the dot character and the thousands separator is omited. Uncheck this option in order to use the numeric format settings
specified above.
The QtiPlot Handbook 242 / 452

Figure 5.149: The Preferences dialog: Numeric Format tab.

5.62.1.5 File Locations Tab

The File Locations tab allows you to define custom locations for the folders containing the translation files, the manual files and
the Python configuration files (qtiplotrc.py and qtiUtil.py) if QtiPlot was built with Python scripting support.
The folder entry Startup Scripts is empty by default. This control is only visible if QtiPlot was built with Python scripting support
and if the Default scripting language is set to Python in the Application tab of this dialog. In this folder one may place all the
Python script files (*.py) that should be loaded and executed when QtiPlot starts.
The LaTeX Compiler and LaTeX Preamble fields are useful if you want to add TeX formated equations to 2D plots and you prefer
to generate them using a compiler installed on your computer. The LaTeX Preamble field is optional, you may leave it blank.
In the LaTeX Compiler field you must provide the path to the LaTeX executable. On Linux this path is set by default to
/usr/bin/latex. On Windows operating systems you need to choose the location of the latex.exe file. A very popular
LaTeX compiler for Windows is MiKTeX. On macOS you can use the LaTeX distribution provided by the MacPorts project. In
this case the path to the LaTeX executable is probably /opt/local/bin/latex.
The QtiPlot Handbook 243 / 452

Figure 5.150: The preferences dialog: File Locations Tab.

5.62.1.6 Keyboard Tab

The Keyboard tab makes possible to define custom shortcuts for all actions in the menus and toolbars of QtiPlot.
The QtiPlot Handbook 244 / 452

Figure 5.151: The preferences dialog: Keyboard Tab.

5.62.1.7 Internet Connections Tab

Settings on the Internet Connection tab are only needed if you connect to the internet via a proxy server. If you don’t now how
to set these options, contact your Network Administrator or other suitably knowledgeable person.
The QtiPlot Handbook 245 / 452

Figure 5.152: The preferences dialog: Internet Connection Tab.

5.62.2 Tables Preferences

5.62.2.1 Options Tab

Selecting the Tables icon opens the second page of the preferences dialog which allows customizing default aspects of tables:
background, text colors and fonts for tables and labels.
The QtiPlot Handbook 246 / 452

Figure 5.153: The Preferences dialog: table options.

If the Automatically Recalculate Column Values option is checked, all modifications in the values of a column trigger a recalcu-
lation of all columns with formulas depending on the modified column.
The controls in the Columns group box can be used to select the default column Type and Numeric Format. The Alignment
selection box can be used to define the default position of the text in the table cells: the text can be aligned with the left or right
edge of the columns or centered horizontally in the available space.
The controls in the Display group box can be used to select what information is visible in the the table header below the column
names. Available options are the Long Names, the Units, the column Comments and the column formulas, F(x).
The Preview group box can be used to define the size of the picture that is displayed for each table column after a right click on
the colum header. Unchecking this group box disables the display of the preview picture.
Checking the Scale to paper size option from the Print group box, ensures that the width of large table windows will fit onto the
paper when printed. This is achieved by scaling horizontally the table columns. This option is checked by default.
When creating a 3D plot from a Z table column, QtiPlot generates a hidden matrix window that is used to store the data for the
plot window. The controls in the Convert to Matrix - Regular XYZ group box allow to customize this process of generating a
hidden matrix from a table that contains regularly spaced XY data.
In order for the input data to be classified as regular, the values in the X and Y columns must meet specific requirements: both
the X and the Y data values must be equally spaced, only small irregularities of the data are allowed. The value of the tolerance
for irregularities in both X and Y directions can be customized via the Tolerance for Duplicate X and Tolerance for Duplicate Y
input boxes, respectively. These two input values must be between 0 and 1.
The Replace Duplicates With list box is useful if several Z values correspond to the same XY data pairs within the user specified
tolerances. The user can choose how these Z values should be combined into a single value. The possible ways to generate a
single Z value are:

Mean: the mean of the duplicate Z values is used (default functioning mode).
Minimum Value: the minimum Z value is used.
Maximum Value: the maximum Z value is used.
The QtiPlot Handbook 247 / 452

Sum: the sum of the duplicate Z values is used.


None: the last of the duplicate Z values is used.

5.62.2.2 Descriptive Statistics Tab

Via this tab you can select the quantities to be computed and displayed in the columns of the result tables generated by the Statis-
tics -> Descriptive Statistics -> Statistics on Columns and Statistics -> Descriptive Statistics -> Statistics on Rows commands.

Figure 5.154: The Preferences dialog: descriptive statistics options.

The following Moments can be computed by QtiPlot:

N The number of valid values, Xi, in the dataset. Empty data cells are ignored.
Mean The arithmetic mean of the dataset:

Standard deviation (SD) The standard deviation is defined as the square root of the variance:

Standard error SD/N1/2

Variance
Sum The sum of all values in the dataset:

Skewness The skewness measures the asymmetry of the tails of a distribution. It is calculated using the following formula:
The QtiPlot Handbook 248 / 452

Kurtosis The kurtosis measures how sharply peaked a distribution is, relative to its width. It is normalized to zero for a Gaussian
distribution:

Mean + 95% Confidence Interval The upper limit of the 95% confidence interval for the mean of the column data. It is
calculated as Mean + t0.975,N-1 SD/N1/2 , where t0.975,N-1 is the Student’s t distribution with N - 1 degrees of freedom.

Mean - 95% Confidence Interval The lower limit of the 95% confidence interval for the mean of the column data. It is calcu-
lated as Mean - t0.975,N-1 SD/N1/2 , where t0.975,N-1 is the Student’s t distribution with N - 1 degrees of freedom.

Before computing the following Quantiles, QtiPlot sorts the input dataset in ascending order.

Minimum Value The first value in the sorted dataset.

Index of Minimum Value The index number of the minimum value in the original (unsorted) dataset.
Q1 (1st Quartile) First (25%) quantile.
Median The median is the second (50%) quantile, Q2.
Q3 (3rd Quartile) Third (75%) quantile.

Maximum Value The last value in the sorted dataset.


Index of Maximum Value The index number of the maximum value in the original (unsorted) dataset.
Interquartile Range (IQR) The interquartile range is a measure of the statistical dispersion, being equal to the difference be-
tween the third and first quantiles: IQR = Q3 - Q1.

Custom Percentiles You can also define a list of custom percentiles. Only integer percentile values between 1 and 99 are
accepted. They must be separated by a whitespace character.

5.62.3 2D Plot Preferences

Selecting the 2D Plots Icon opens the third page of the preferences dialog. This set of options is used to customize default
aspects of 2D plots.

5.62.3.1 Options Tab

The Options tab may be used to customize the general behavior of the plot layers. Most of the changes made to these options
will be applied only to newly created plots. Changing the options from the General group box: Autoscaling, scaling of fonts and
the behavior on resize events will affect existant plots.
The controls in the Layer group box can be used in order to set a default background and a solid border for each 2D plot layer
and to customise the Canvas Color, where the canvas is the drawing area for 2D plot curves.
The controls in the Window group box can be used in order to set a default background and a frame for each newly created 2D
plot window.
The controls in the Data Drawing Options group box can be used in order to set the default drawing options that can be modified
later on for each plot layer via the Layer Display tab of the Plot Details dialog.
If the Margins box is checked QtiPlot automatically adds some amount of space before and after the data values along each axis
scale. The effect of this option is mainly visible when creating new plots from table columns or when rescaling a plot layer so
that all data on the graph is visible, using the Graph -> Rescale To Show All command.
The names of the other options in this group box should be self explaining.
The QtiPlot Handbook 249 / 452

Figure 5.155: The preferences dialog: 2D plot options.

5.62.3.2 Curves Tab

The Curves tab contains a number of controls that define the default style used when creating a new plot.
The controls in the Indexed Colors group box can be used in order to customize the incremental list of default colors used by
QtiPlot when plotting a group of data sets or for filling the segments of pie charts. The Palettes box provides four color lists:
Default, LibreOffice, Origin1 and Origin2. These palettes can be loaded into the color list editor by pressing the Apply button
next to the Palettes list box.
The indexed color list can be edited using the tool buttons on the right side: the New Color button, the Delete Color button,
the Move Color Up button and the Move Color Down button. It is possible to save a custom indexed color list to a text file
(*.txt), by pressing the Save As... button. The structure of this file is very simple: the colors are saved one per line, using the
RGB format #RRGGBB. The text file can be loaded later on into the color list editor by pressing the Open File... button.
The QtiPlot Handbook 250 / 452

Figure 5.156: The Preferences dialog: Curves Tab.

5.62.3.3 Symbol Tab

The Symbol tab contains a number of controls that define the default 2D symbol style used when creating a new plot.
The controls in the Indexed Symbols group box can be used in order to customize the incremental list of default symbols used by
QtiPlot when plotting a group of data sets. The indexed symbol list can be edited using the arrow buttons on the right side: the
Move Symbol Up button and the Move Symbol Down button. The default symbols list can be reloaded by pressing the Load
Default button.
The QtiPlot Handbook 251 / 452

Figure 5.157: The Preferences dialog: Symbol Tab.

5.62.3.4 Error Bars Tab

The Error Bars tab contains the controls that define the default style used when adding error bars to a 2D plot curve.
The QtiPlot Handbook 252 / 452

Figure 5.158: The Preferences dialog: Error Bars Tab.

5.62.3.5 Axes Tab

The first panel in this tab allows to specify the dominant stylistic aspects of the plot axes like their Thickness, the visibility of the
backbone line (with the help of the Draw backbones check box) and the space between the axes and their title and between the
major ticks and their corresponding labels.
The Synchronize scale divisions box is checked by default, meaning that the scale range and the tick divisions of the opposite
layer axes (left/right and bottom/top) are automatically forced to have the same values when you modify any of them. If you
need to represent different data ranges for each axis you should uncheck this box. This option can also be set for individual 2D
plot layers using the Synchronize scales box from the Layer tab of the Plot details dialog.
If you want that the axes intersect in the center of the plot layer you should check the Crossing axes layout box. With the help of
the controls from this panel it is possible to precisely define the positions of the Horizontal and Vertical axes either in percentages
of the plot canvas dimensions (width and height) or by specifying a custom scale value.
Using the controls in the Arrow group box it is possible to define a default end arrow shape for the Horizontal and Vertical axes
only. The Left, Right, Bottom and Top axes cannot display arrows at their end point.
The Enabled axes panel controls which axes and more precisely which axes elements will be visible in a new plot layer. With
the use of the Show check box it is possible to enable/disable a plot axis. The display of the major tick labels is controlled with
the Labels check box. If you want to disable the display of an axis title you simply remove the text in the Title edit box.
The QtiPlot Handbook 253 / 452

Figure 5.159: The Preferences dialog: Axes Tab.

5.62.3.6 Ticks Tab

The Ticks tab defines the default style for axis ticks drawn on newly created plots. The option Max Number can be used in order
to set a limit for the number of major ticks that are displayed on each axis if the plot layer is rescaled automatically, for example
after using the Rescale To Show All command.
The QtiPlot Handbook 254 / 452

Figure 5.160: The Preferences dialog: Ticks Tab.

5.62.3.7 Grid Tab

The Grid tab defines the default aspect of plot layer grids.
The QtiPlot Handbook 255 / 452

Figure 5.161: The Preferences dialog: Grid Tab.

5.62.3.8 Geometry Tab

The Geometry tab defines the default size for the drawing area of a plot layer and the margins around the layers. When the Keep
aspect ratio option is checked, changing either the width or height will proportionally change the other dimension. Also, the
aspect of the plot canvas (ratio between width and height) will remain unchanged for all future plot layers when you manually
resize a graph window.
The QtiPlot Handbook 256 / 452

Figure 5.162: The Preferences dialog: Geometry Tab.

5.62.3.9 Speed Tab

The Speed tab lets the user enable/disable antialiasing when drawing/redrawing 2D plots. Antialiasing is a major source of slow-
down when rendering 2D plots. Unchecking the Antialiasing checkbox disables antialiasing for all curves, which probably will
only be needed in extreme circumstances. Checking the Disable for curves with more than checkbox will disable antialiasing
only for curves having data sets larger than the threshold set with the textbox to the right of the Disable for curves with more
than checkbox. Disabling this option is probably not a good idea. The default is for both of these options to be enabled, with a
threshold of 1000 data points. Proper setting of these options is essential to keeping the application responsive.
The option Disable mouse tracking for curves with more than ... data points can be used to stop detecting the position of the
mouse pointer for curves with a very large number of data points. Data tools like the Data Reader command or the Select
Data Range command will no longer work for the curves with more data points than the value defined for this option, but the
application will be more responsive.
The QtiPlot Handbook 257 / 452

Figure 5.163: The Preferences dialog: Speed Tab.

5.62.3.10 Fonts Tab

The Fonts tab defines the default fonts used when creating new plots. Options are provided for the plot Title, plot Legend, Axes
Labels, and Axes Numbers.
The QtiPlot Handbook 258 / 452

Figure 5.164: The Preferences dialog: Fonts Tab.

5.62.3.11 Print Tab

The Print tab allows you to control a few default options that are used when printing 2D plots. If you want layers to be printed
with their original dimensions, you must be sure to uncheck the Scale layers to paper size option. Checking the Print Cropmarks
option ensures that some visible marks will be drawn around the borders of the plot.
The QtiPlot Handbook 259 / 452

Figure 5.165: The Preferences dialog: Print Tab.

5.62.4 3D Plot Preferences

5.62.4.1 Options Tab

Selecting the 3D Plots Icon opens the fourth section of the preferences dialog. This set of options is used to customize default
aspects of three dimensional plots.
The first page in this section is the Options tab, which allows to set a default size for 3D plot windows as well as default rotation
angles around the three axes. Please note that the default size is the canvas size, it doesn’t include the window frame.
The QtiPlot Handbook 260 / 452

Figure 5.166: The preferences dialog: 3D plot options tab.

The color buttons in the Colors group box help define the aspect of the various plot elements like the axes, the scale numbers,
the window background, etc... Their meaning should be self-explanatory.
The Smooth Line check box from the General controls group can be used to enable/disable the OpenGL GL_LINE_SMOOTH
option: if enabled, QtiPlot draws antialiased lines, otherwise all lines are aliased.
If the Autoscaling option is checked, QtiPlot will automatically update the scale ranges for the three axes when the source data
sets of the 3D curves/surfaces in a 3D plot are modified.
The Scale Fonts option enables the automatic change of the font sizes used for the various 3D plot elements with the size of the
plot window. By default, this option is disabled, since it might lead to wrong results in some special cases.

5.62.4.2 Curves Tab

The second page in this section is the Curves tab, which allows to set the default preferences for 3D curves and surfaces.
The QtiPlot Handbook 261 / 452

Figure 5.167: The Preferences dialog: 3D curves tab.

The Style list box can be used to define the default appearance for 3D analytical functions or parametrical surfaces. Available
styles are: Wireframe, Hidden line, Polygon only, Mesh + Filled polygons, Scatter and Bars.
The Floor style list box allows to define the floor projection of a 3D surface. One can enable a full 2D projection or only display
the isolines. The following floor projection styles are available: Empty (the default), Isolines (the isoline projections are visible)
and Projection (the 2D projected polygons are visible). If the floor style is set to Isolines, the number of projected isolines can
be customised using the Isolines input box bellow.
The Shading defines the way the 3D polygons are rendered. The following shading styles are available:

Flat The GL_FLAT shading mode from OpenGL: the color of a polygon in the 3D surface is given by only one of its vertices.
Smooth The GL_SMOOTH shading mode from OpenGL: the colors of all vertices composing a polygon are interpolated, as-
signing different colors to each resulting pixel fragment of the rendered surface.
Isolines The polygons composing the rendered surface are filled to the isoline contours.
Isolines 2 Same as previous method: the polygons composing the rendered surface are filled to the isoline contours. This method
is less accurate than Isolines and may fail for very complex data, but is a litle bit faster and gives nicer results for smooth
surfaces.

If the Legend option is checked, QtiPlot automatically displays a legend item for each curve or surface added to a 3D plot window.
The text of the legend item has the syntax %(index), where the % character is an alias for the name of the data set and the integer
value between the round brackets is the index of the curve/surface. The drop list box on the right becomes available only is the
Legend box is checked and allows to select the translation mode for the % character.
The Y drop list box can be used in order to specify the way to calculate the Y values that are used for XYY plot curves. In
the Auto mode the Y value is equal to the index of the 3D XYY curve. In the case of the other modes: Long Name, Units and
Comments, QtiPlot reads the Y values from the corresponding fields of the Y column used to create the XYY curve.
The controls in the Mesh group box define the aspect of the lines that are drawn in the case of 3D curves or surfaces having the
Wireframe, Hidden line, Mesh + Filled polygons or Line + Symbols style.
The QtiPlot Handbook 262 / 452

The controls in the Fill area under curve group box define the default color used to fill the area bellow a 3D curve drawn by the
Waterfall Plot and Waterfall Plot (Color Mapped) commands, as well as the possibility to draw the Side Lines and the Baseline.
The Skip Points option from the Data Drawing Option control box is more or less akin to a speed drawing mode, which can be
very useful when working with large data sets. Larger values of the Skip Points option result in fewer data points being drawn on
3D plots, and therefore a higher drawing speed. When Skip Points is set to 0, all data points are drawn.
If the Margins box is checked, QtiPlot automatically adds some amount of space before and after the data values along each axis
scale, in an attempt to find reasonable scale ranges. The effect of this option is mainly visible when creating new plots from table
columns or when rescaling a plot layer so that all data on the graph is visible, using the Graph -> Rescale To Show All command.

5.62.4.3 Axes Tab

Using the Axes tab it is possible to fully customize the appearance of the coordinates system in a 3D plot.

Figure 5.168: The Preferences dialog: 3D axes tab.

The following coordinate system styles are available:

Box The coordinate system is drawn as a box: all 12 axes are visible, but only three of them are decorated with ticks and
numbers. When this default style is chosen, it is possible to hide one of these 12 axes, using the Hide axis option, so that
the result is a coordinate system with four sides.
Frame Only three axes are visible.
1/2 Box (Right) Three sides of the box are visible: the right side, the back and the floor.
1/2 Box (Left) Three sides of the box are visible: the left side, the back and the floor.

By default, the three axes decorated with ticks and numbers are X1, Y1 and Z1. By setting the Enabled axes option to Custom,
it is possible to specify which axes should be decorated, using the X, Y and Z drop lists that are enabled in this case.
The perspective view mode can be enabled/disabled by default using the Orthogonal box.
The QtiPlot Handbook 263 / 452

5.62.4.4 Grids Tab

If the coordinate system is visible, you can enable the display of a default grid for each of its six sides, by checking the corre-
sponding boxes from the Show group box.

Figure 5.169: The Preferences dialog: 3D grids tab.

The default color, pen style and line width can be customized for both major and minor grid lines, using the controls from the
Format group box.

5.62.4.5 Planes Tab

Using the Planes tab, it is possible to set a color filling for the six sides of the coordinate system. Please note that transparency
of these planes is not correctly handled when exporting 3D plots to vectorial image formats (*.EPS, *PDF or *.SVG files). It is
also possible to set a default colored Border for the sides of the coordinate system.
The QtiPlot Handbook 264 / 452

Figure 5.170: The Preferences dialog: 3D planes tab.

5.62.4.6 Colors Tab

The Colors tab makes possible to define a default color map to be used for rendering 3D surfaces with style set to Polygon only
or Mesh + Filled polygons and for the symbols of 3D curves.
If the Scale Colors box is checked, a Z value will be represented by a color defined as a linear interpolation between the adjacent
values in the color table.
It is possible to load or store a colormap from/to a XML file by pressing the Open file and Save buttons.
A click on the Level column header opens the Set Equidistant Levels dialog, which allows to quickly edit the color map levels by
specifying their total number and an intensity range.
A click on the Color column header opens the Gradient Fill dialog, which allows to quickly customize the colors in the map.
The Opacity slider can be used in order to modify the alpha channel of the color map from 0 % (totally transparent) to 100 %
(fully opaque).
The QtiPlot Handbook 265 / 452

Figure 5.171: The Preferences dialog: 3D colors tab.

5.62.4.7 Fonts Tab

Using the controls in the Fonts tab you can customize with just a few clicks the fonts for the various elements in a 3D plot: title,
axes labels and scale numbers. The Labels font, the last in the list, is used by QtiPlot for new legend items and text objects, as
well as for the curve labels that can be displayed near each data point.
The QtiPlot Handbook 266 / 452

Figure 5.172: The Preferences dialog: 3D fonts tab.

5.62.5 Notes Preferences

Selecting the Notes Icon opens the fifth page of the preferences dialog. This set of options is used to customize some of the
default characteristics of the text editors, such as the length of the TAB character and the font. The user can also specify whether
or not line numbers should be displayed. Displaying the line numbers can be particularly helpful when debugging Python scripts.
The QtiPlot Handbook 267 / 452

Figure 5.173: The preferences dialog: note options.

5.62.6 Fitting Preferences

Selecting the Fitting Icon opens the sixth page of the preferences dialog. This page is used to set default fitting options. Most
of the options are standard and straightforward.
The Generated Fit Curve options may be confusing at first glance. While it may be typical to plot a fit curve as y=f(x) using
the original X data that was used in the fitting operation, QtiPlot provides the alternative (by selecting the Uniform X Function
option) of plotting the curve using a user specified number of X data points (default=100) uniformly spaced over the X range of
the fit. Since linear fits are completely defined by 2 points, you can also have QtiPlot default to simply plotting linear fits using 2
data points by checking the 2 points for linear fits option.
The QtiPlot Handbook 268 / 452

Figure 5.174: The preferences dialog: fitting options.

The options in the Curves group box can be used to specify if additional curves should be displayed after each fit operation. If the
Conf. Bands and Pred. Bands options are checked QtiPlot generates confidence bands and prediction bands, based on the user
defined value for the confidence level. If the Residuals Plot option is checked the curve of the fit residuals is also generated. The
residuals are calculated as the difference between the experimental values and the response values predicted by the fit model.
The controls in the Parameters Output group box can be used in order to define the default options for the display of the results
from data fit operations. The Format list box allows to choose a default numerical format. The value of the Significant Digits
option can be used to customize the precision of the output and has a different meaning depending on the numeric format. The
following format and precision options are available:

Default - Decimal or scientific e-notation, whichever is the most concise. The value of the Significant Digits control represents
the maximum number of significant figures in the output (trailing zeroes are omitted).
Decimal: 1000 - Decimal notation. The value of the Significant Digits control represents the number of digits after the decimal
point.
Scientific: 1E3 - Scientific e-notation where the letter e is used to represent "times ten raised to the power of" and is followed
by the value of the exponent. The value of the Significant Digits control represents the number of digits after the decimal
point.

The errors on the fit parameters are displayed in the log window only if the Error box from the Results Log group is checked.
The Scale Errors with sqrt(Chiˆ2/doF) option only affects the errors on the parameters reported after the fit operation. It does not
affect the fitting process or the data in any way. If checked, the reported errors on the parameters, ε j , are calculated as the square
root of the diagonal elements of the covariance matrix Cov(j, j) multiplied with sqrt(Chi2 /(n - p)), where n is the number of data
points and p the number of fit parameters. Otherwise, the reported errors equal the square root of the diagonal elements of the
covariance matrix Cov(j, j).
If the LCL and UCL options from the Results Log group box are checked QtiPlot also displays the confidence limits for each fit
parameter based on the value of the confidence level specified in the Curves box.
The controls in the Statistics group box can be used in order to define the default fit statistics to be displayed in the results log
window after data fit operations. For more details about the meaning of these values, please visit the Data fiting section from the
chapter dedicated to the Analysis of data and curves.
The QtiPlot Handbook 269 / 452

For all data analysis operations, not only fitting, there is a mechanism introduced in release 0.9.9.11 of QtiPlot that allows
to trigger a recalculation when the data source is modified. It is possible to specify the desired recalculation mode using the
Recalculate list box. The available options are:

No - No recalculation when data changes.


Auto - A recalculation is automatically performed when input data changes. This is the default option.
Manual - No recalculation is triggered when data changes, instead the user can perform a recalculation at any time by pressing
the Recalculate button from the Analysis tab of the plot details dialog.

Please note that if the recalculation mode is set to No the fit object is deleted from memory when the operation ends. In the
other two cases the fit object is attached to the result plot curve and stored into the memory of the output graph window. The
recalculation mode can be changed later on via the Analysis tab of the plot details dialog.
If the Apparent Fit option is checked, QtiPlot uses the apparent values for fitting, according to the current axis scales. For
example, select this box to fit exponentially decaying data with a straight line fit when data are plotted on a log scale. When this
check box is selected and the data has error values associated with it, QtiPlot uses the larger of the positive/negative errors as
weight. Apparent Fit is only useful when you fit from a graph and change the plot axis type (from Linear to Log10, for example).
If you check this option, QtiPlot will first transform raw data into new data space as specified in the graph axis type, and then fit
the curve with the new data. Otherwise, QtiPlot always fits raw data directly, regardless of the axis type. Apparent fit is equivalent
to direct fit if you first transform raw data on the worksheet, and leads to completely different results from direct fit if your graph
axis is non-linear.

5.63 Serial Port Settings

This dialog is opened by selecting the Edit | Preferences... action from the Serial Monitor window.

Figure 5.175: The Serial Port Settings dialog.

The Name control in the Serial Port group box of this dialog displays the list of all available serial ports. Upon selection of a
port from this list the other controls display all the information available for this port: description, manufacturer, serial number,
system location, vendor and product identifiers.
The controls in the Parameters group box allow to configure the connection to the selected serial port. The following parameters
can be customized: Baud Rate, Data bits, Parity, Stop bits and Flow control.
The serial monitor window can also be used in order to write data to a serial port, by placing the cursor inside it and entering the
text from the keyboard. If the Local echo box from the Options control group is checked each character typed and sent to the
serial port is also printed in the terminal window. This is the default operating mode.
The QtiPlot Handbook 270 / 452

If the Add Time Stamp box from the Options control group is checked, the time information using the format string "hh:mm:ss.zzz"
is prepended to each data line read from the serial port.
The string specified in the Separator list box is also inserted between the time stamp and the data line read from the serial port.
This string is automatically set as the default column separator for the ASCII import dialog.

5.64 Serial Monitor

This window can be used in order to read/write data from/to available serial ports. It can be opened by selecting the Serial
Monitor... command from the View menu.

Figure 5.176: The Serial Monitor Window

The actions in the tool bar provide quick access to the main operations that can be performed on a serial port. These actions can
be also triggered via the four menus available for this window: File, Edit, Data and Help.
The actions available in the File menu are:

New -> Table (Ctrl-T) Creates a new active table used to store the data available from the serial port. The data lines are split
in several columns using the column separator defined in the Serial Port Settings dialog. New lines are added to the table,
one by one, as they become available for reading from the serial port.
New -> Graph (Ctrl-G) If there is no active data table, this action creates a new hidden table and plots the imported data
columns into a new plot window using the default user settings for new 2D graphs.
Save (Ctrl-S) Opens a file save dialog allowing to choose the path where to save the data available in the monitor window.
Import ASCII... (Ctrl-K) Opens the ASCII import dialog allowing to define the default import settings for the data available
in the monitor window. The data available in the monitor window is saved to a temporary .txt file, the name and path of
this file being displayed in the dialog.

Quit Closes this window.

The actions available in the Edit menu are:

Preferences... Opens the Serial Port Settings dialog allowing to select the name of an available serial port and its parameters.
Copy (Ctrl-C) Copies the text from the monitor window into the clipboard.
Clear Clears the text available in the monitor window and also removes all lines from the active data table, if any.

The actions available in the Data menu are:


The QtiPlot Handbook 271 / 452

Connect (Ctrl+R) Tries to open a connection to the serial port using the parameters specified in the Serial Port Settings
dialog. Once the connection is established, the information about the name of the current serial port and the parameters
used for the connection is displayed in the status bar of this window.

Disconnect Closes the connection with the serial port.

The Help menu contains a single action, Help, that can be used in order to open the quick help panel and to display this chapter
from the user manual.

5.65 Printer-setup

This dialog box is opened by the Print command from the File menu or by entering the Ctrl-P key. It is used to print the selected
window (plot or table) and its exact appearance will depend both upon your operating system and the printers that you have
available. The following screenshot shows the dialog on a Linux system with one printer that uses the KDE window manager.

Figure 5.177: The Print dialog.


The QtiPlot Handbook 272 / 452

5.66 Set Column Values

This dialog is activated with the Set Column Values... command from the Table menu or by entering the shortcut Alt-Q. It
provides for filling a column with the result of a function evaluation.
If the option Display formulas in header is checked, the custom functions defined for all columns will be shown in the table
header. This feature can be enabled by default via the Tables tab from the Preferences dialog by checking the option F(x) in the
Display group box.
The available mathematical functions can be viewed with the help of the function selector button which displays the capital greek
letter sigma ∑. By pressing this button a dropdown menu of intrinsic functions grouped by the first letter of their name will
be shown. Selecting a function name will copy it into the function definition pane. Details of these functions and supported
mathematical operators are listed in the muParser section in the chapter on Mathematical Expressions and Scripting. Also a
tool tip for function syntax is displayed by double-clicking an inserted function name while keeping the left button of the mouse
pressed.
The special function, col(c), is used to access the values of column c, where c is the column’s number (as in col(2)) or its name
in double quotes (as in col("time")). You can also obtain values from other tables using the tablecol(t,c) function, where t is the
table’s name in double quotes and c is the column’s number or its name in double quotes (example: tablecol("Table1","time")).
The variables i and j can be used to access the current row and column numbers. Similarly, sr and er represent the selected
starting and ending row, respectively.
Using Python as scripting language gives you even more possibilities. Not only can you use arbitrary Python code in the function
body, but also access other objects within your project. The current table can be accessed using the self key word, like in the
script example bellow. The script fills the first column of the table with ascending values and all other columns with random
values:
self.column(1).setRowValues()
for i in range(2, self.numCols() + 1):
c = self.column(i)
c.setRandomValues()
c.updateView()

For more details on the Python API available in QtiPlot, see the section on Pythonin the chapter on Mathematical Expressions
and Scripting. Nevertheless, even though Python allows for a more powerful syntax, it can be quite slow for very large tables.
Therefore you might want to use muParser instead, even when Python is set as the default script engine for your current project.
Checking the Use built-in muParser option will force the use of muParser as the scripting engine. This greatly increases the
speed of the evaluation for single line expressions.

Figure 5.178: The Set Column Values... dialog.

The status bar at the bottom of this dialog displays the current Position of the editing cursor as well as any error messages that
might occur during the evaluation of the user provided function.
The QtiPlot Handbook 273 / 452

Warning: When you make changes to the values in a table which contains "filled" values, the dependent values are not recomputed
unless the Automatically Recalculate Column Values option is checked in the Tables tab of the Preferences dialog. If this option
is unchecked, you will have to explicitly tell QtiPlot to recalculate individual cells or whole columns or rows by selecting
"Recalculate" from their context menu or by pressing Ctrl-Return.

5.67 Extract Data

This dialog is activated with the Extract Data... command from the Table menu. It opens a dialog which allows you to define
a set of conditions that are used to filter the data in the currently active table. When a condition has been defined, Applying the
condition will create a new table into which all rows that meet the condition will be copied. The original table is unchanged. For
example, the condition col("1") > 0.5 will generate a new table that contains all the rows from the active table which have a value
greater than 0.5 in column 1.

Figure 5.179: The Extract Data... dialog.

The available mathematical functions can be viewed with the help of the function selector button which displays the capital greek
letter sigma ∑. By pressing this button a dropdown menu of intrinsic functions grouped by the first letter of their name will
be shown. Selecting a function name will copy it into the function definition pane. Details of these functions and supported
mathematical operators are listed in the muParser section in the chapter on Mathematical Expressions and Scripting. muParser
is the only scripting language that can be used in this dialog.
The special function, col(c), is used to access the values of column c, where c is the column’s number (as in col(2)) or its name
in double quotes (as in col("time")). You can also obtain values from other tables using the tablecol(t,c) function, where t is the
table’s name in double quotes and c is the column’s number or its name in double quotes (example: tablecol("Table1","time")).
The variables i and j can be used to access the current row and column numbers. Similarly, sr and er represent the selected
starting and ending row, respectively.
The filtering condition is built with the common operators +, -, *, /, %, and ˆ (for addition, subtraction, multiplication, division,
modulus operator and exponentiation, respectively) and the logical operators: >, >=, <, <=, !=, ==. These operators can be added
by pressing the + button and choosing the operator needed from the dropdown menu.

5.68 Set Matrix Dimensions

This command appears in the Matrix menu. It allows direct specification of the number of rows and columns of a matrix. In this
window, you can also define a linear range for X-values and Y-values. These X and Y ranges will be used in new plots as the
initial scale ranges. They are also available via the x and y variables if you choose to define the contents of the matrix with the
Set Values Dialog.
The QtiPlot Handbook 274 / 452

Figure 5.180: The Set Dimensions... dialog for matrix.

It is also possible to define non-linear X/Y coordinates using data values from table columns via the controls in the Set coordinates
from table group box. If the Current folder box is checked only the tables from the current project subfolder are displayed in the
table selection list boxes.
The column used for the X coordinates must contain a number of valid, non empty cells at least equal with the number of columns
in the matrix. Similarly, the column used for the Y coordinates must contain a number of valid, non empty cells at least equal with
the number of rows in the matrix. QtiPlot sorts these data values in ascending order before assigning them as matrix coordinates.
You can also define a Long Name, Units and Comments for X / Y / Z coordinates under the X Labels, Y Labels or Z Labels tab.
These labels can be used as X / Y /Z axis labels in 3D graphs.

5.69 Resample Matrix Dialog

This dialog is opened by the Expand... and Shrink... commands from the Matrix menu. This dialog allows to change the
dimensions of a matrix, the old and new dimensions being displayed at the top of the dialog.

Figure 5.181: The Resample Matrix Dialog dialog for a matrix.


The QtiPlot Handbook 275 / 452

There are three resampling modes available: Expand for every cell, Shrink into 1x1 for every and Resize freely.
The Method box allows to choose the interpolation method to be used when calculating the values of the new cells in the
resampled matrix. There are two methods available: bilinear and bicubic. The implementation of the bicubic interpolation in
QtiPlot uses the algorithm from the SPLINE library written by John Burkardt. Please be aware of the fact that the bicubic
interpolation fails if the matrix contains empty cells.

5.70 Matrix Properties

This command is located in the Matrix menu. It allows setting some global properties of the selected matrix, such as the cell
width (in pixels) and the format used for numbers.

Figure 5.182: The Set Properties... dialog for matrices.

5.71 Set Matrix Values

This command is located in the Matrix menu. It allows filling in a matrix with the results of evaluating a function, z=f(i,j), in
which i and j are the row and column numbers.
You can use the X-values and Y-values defined with the Set Dimensions... command, and also define your functions based on the
x and y variables.
Functions can span several lines. The available intrinsic functions are listed in the muParser section of the Mathematical Expres-
sions and Scripting chapter.

Figure 5.183: The Set Values... dialog for matrix.


The QtiPlot Handbook 276 / 452

Using Python as scripting engine for the calculation of matrix values has the advantage of a more powerful syntax. The current
matrix can be accessed using the self key word, like in the script example bellow, which fills the matrix with random values:
from random import random
for i in range (1, self.numRows() + 1):
for j in range (1, self.numCols() + 1):
self.setCell(i, j, random())

For more details on the Python API available in QtiPlot, see the section on Python in the chapter on Mathematical Expressions
and Scripting . The drawback of using Python as scripting engine is that it can be quite slow for large matrices. You can use
muParser instead, even if Python is set as the default script engine for your QtiPlot project, by checking the Use built-in muParser
box. Note that muParser is very fast for the evaluation of single line expressions only, therefore try to avoid syntax like:
a = cell(1, 1)
b = cell(2, 2)
a*b*x + b*x*x + a

in preference for something like the following:


cell(1, 1)*cell(2, 2)*x + cell(2, 2)*x*x + cell(1, 1)

which will greatly increase the speed of evaluation!


The status bar at the bottom of this dialog displays the current Position of the editing cursor as well as any error messages that
might occur during the evaluation of the user provided function.

5.72 Bin Matrix Dialog

Figure 5.184: The Bin Matrix Dialog dialog box.

This dialog is opened when you select the Convert to Matrix -> 2D Binning... command from the Convert to Matrix menu. It
allows to customize the process of generating a new matrix by counting the number the data points falling within a given XY
range and storing the bin counts as Z values in this new matrix.
The initial coordinates of the output matrix are automatically calculated from the input data range, but of course you can cus-
tomize them via the input boxes from the Matrix Coordinates group box. The Columns and Rows input boxes in the Matrix
Dimensions group allow to specify the number of bins in the X and respectively Y range.
In order to understand how the frequency count process works please consider the following example: the table to be converted
has two columns (X and Y) both containing random values between 0 and 1. We decide to create a new matrix with 10 rows and
10 columns, that is 100 bins. If we represent the input data using a scatter plot we get the graph bellow, where the scale divisions
were changed to have a 0.1 step for both axes. In this graph, each square of the plot grid represents a 2D bin. QtiPlot counts the
number of scatter points in each square and stores these values in the new matrix.
The QtiPlot Handbook 277 / 452

Figure 5.185: Scatter plot showing the number the data points falling within each 2D bin.

5.73 Regular XYZ Gridding Dialog

This dialog is opened when you select the Convert to Matrix -> Regular XYZ... command from the Convert to Matrix menu. It
allows to customize the process of generating a new matrix from a table that contains regularly spaced XY data.
If the Preview box is checked, this dialog displays in the Grid tab a 2D scatter plot of the Y versus X data columns that are
associated with the selected Z dataset. This graph allows to check the regularity of the input data: the spacing in the X and Y
dimensions should be regular.
In order for the input data to be classified as regular, the values in the X and Y columns must meet specific requirements: each X
value must have the same number of Y values and each Y value must have the same number of X values. In addition, both the X
and the Y data values must be equally spaced: only small irregularities of the data are allowed.
The QtiPlot Handbook 278 / 452

Figure 5.186: The Regular XYZ Gridding dialog box: XY data grid preview.

The value of the tolerance for irregularities in both X and Y directions can be customized via the Tolerance for Duplicate X and
Tolerance for Duplicate Y input boxes, respectively. These two input values must be between 0 and 1.
For two adjacent data points (x1 , y1 , z1 ) and (x2 , y2 , z2 ), if |(x1 - x2 )/(x1 + x2 )| < ToleranceX the two X values are considered to
be duplicates. The same formula is applied in the Y direction: if |(y1 - y2 )/(y1 + y2 )| < ToleranceY than the two Y values are also
considered to be duplicates.
The Replace Duplicates With list box is useful if several Z values correspond to the same XY data pairs within the user specified
tolerances. The user can choose how these Z values should be combined into a single value. The possible ways to generate a
single Z value are:

Mean: the mean of the duplicate Z values is used (default functioning mode).
Minimum Value: the minimum Z value is used.
Maximum Value: the maximum Z value is used.
Sum: the sum of the duplicate Z values is used.
None: the last of the duplicate Z values is used.

The Matrix Dimensions group box displays the number of columns and rows of the default resulting matrix. If the Resample
box is checked, the Columns and Rows input boxes become editable and the user may also choose an interpolation method
(either bilinear or bicubic). When the values in the Columns or Rows input boxes are modified QtiPlot automatically resizes the
dimensions of the result matrix.
The QtiPlot Handbook 279 / 452

If the Preview box is checked, this dialog also displays a 3D plot preview of the resulting matrix together with a scatter plot of
the input XYZ data points in the 3D Surface tab. The aspect of the 3D preview surface can be fully customized using the Plot
type and Floor style controls.

Figure 5.187: The Regular XYZ Gridding dialog box: 3D surface preview.

If the option Create Plot is checked, QtiPlot also creates a 3D plot window of the result matrix when the OK button is pressed,
using the settings specified in the Plot type and Floor style controls.

5.74 Random XYZ Gridding Dialog

This dialog is opened when you select the Convert to Matrix -> Random XYZ... command from the Convert to Matrix menu. It
allows to customize the process of generating a new matrix from a collection of randomly distributed XYZ data samples, using
Shepard’s method.
This interpolation method, also called the Inverse distance weighting method, is often used to derive estimates of the surface
height at the vertices of a regular grid from irregularly spaced samples. Consider N data samples, that is, we have N triples (xi,
yi, zi). We want to estimate the height z given a position on the plane (x, y). The general form for estimating z is given by the
following formula, where p determines the relative importance of distant samples (see the article Nearest neighbour weighted
interpolation by Paul Bourke for more explanations):
The QtiPlot Handbook 280 / 452

Figure 5.188: The Shepard’s interpolation method.

The Search Radius input box in the dialog corresponds to the parameter p from the formula above. The initial dimensions of
the output matrix are automatically set by QtiPlot to be the double of the number of sample data points, but of course you can
customize them via the Columns and Rows input boxes from the Matrix Dimensions group box. The same remark applies to the
controls in the Matrix Coordinates group box.
By checking/unchecking the Preview box it is possible to enable/disable the display of the input samples and of the interpolated
3D surface. The color map used to draw the input data points as well as the color of the surface line mesh and its smootheness
can be customized via the 3D Plots tab from the Preferences dialog.
The QtiPlot Handbook 281 / 452

Figure 5.189: The Random XYZ Gridding dialog box.

5.75 Surface plot options

This dialog box is used to customize 3D plots. It is activated by a double click on a 3D plot.

5.75.1 General Tab

The General tab is used to define some global parameters and the aspect ratio of the plot.
The QtiPlot Handbook 282 / 452

Figure 5.190: The general 3D plot options tab.

You can use the Translation Mode %(1), %(2) drop-down list in the Legends group box to specify the table column header
information that should be used in the curve legends. The second Translation Mode drop-down list in the Auto Axis Titles box
has the same utility with respect to the graph axis titles.
The Data Plot Index control is useful when plotting multiple Y columns of data against a single X column. You can use it in
order to specify which data column will provide the information for the axis titles.
If the option Show Units (when available) is selected the contents of the table column’s Unit property will be appended to the
axis title.
Using the controls in the Animation group box, it is possible to define suitable rotation steps around the three axes. These
parameters become the default settings for all newly created 3D plot windows.

It is possible to start/stop animating the active 3D plot by pressing the Animation button. After the animation process is
stopped, one might want to reset the rotation angles around the three axes to the default values. This can be done by pressing the
Reset rotation button.
By checking the Scale to paper size option from the Print group box, a 3D graph with dimensions that are smaller or larger than
those of the printable area will be printed scaled to the dimensions of the printer page. It is possible to check the Print Cropmarks
box in order to display dashed lines at the margins of the printable area of the 3D plot.
All these settings can be applied to the active window or to all 3D plot windows in the project, depending on the option you
choose in the Apply to list box.

5.75.2 Axes Tab

Using the Axes tab it is possible to fully customize the appearance of the coordinates system in a 3D plot.
The QtiPlot Handbook 283 / 452

Figure 5.191: The general 3D plot axes tab.

The following coordinate system styles are available:

Box The coordinate system is drawn as a box: all 12 axes are visible, but only three of them are decorated with ticks and
numbers. When this default style is chosen, it is possible to hide one of these 12 axes, using the Hide axis option, so that
the result is a coordinate system with four sides.
Frame Only three axes are visible.

1/2 Box (Right) Three sides of the box are visible: the right side, the back and the floor.
1/2 Box (Left) Three sides of the box are visible: the left side, the back and the floor.

By default, the three axes decorated with ticks and numbers are X1, Y1 and Z1. By setting the Enabled axes option to Custom,
it is possible to specify which axes should be decorated, using the X, Y and Z drop lists that are enabled in this case.
The perspective view mode can be disabled/enabled by checking the Orthogonal box.

5.75.3 Grids Tab

If the coordinate system is visible, you can enable the display of a grid for each of its six sides, by checking the corresponding
boxes. The color, pen style and line width of both major and minor grid lines for each of the three axes X, Y or Z, can be
customised using the Grid tab
The QtiPlot Handbook 284 / 452

Figure 5.192: The general 3D plot grids tab.

5.75.4 Planes Tab

Using the Planes tab, it is possible to set a color filling for the six sides of the coordinate system. Please note that transparency
of these planes is not correctly handled when exporting 3D plots to vectorial image formats (*.EPS, *PDF or *.SVG files). It is
also possible to set a Border for the sides of the coordinate system. The color, pen style and line width of the border can be fully
customised.

Figure 5.193: The general 3D plot planes tab.


The QtiPlot Handbook 285 / 452

5.75.5 Lighting Tab

Using the Lighting tab it is possible to add a lighting effect to a 3D plot by checking the Enable box. The sliders in this tab
allow a quick customization of the various components of the light: the ambient, diffuse and specular colors, the shininess and
emission intensity, as well as the direction of the light source.

Figure 5.194: The general 3D plot lighting tab.

The Direction of the light can be controlled with the Horizontal and Vertical sliders, which set the direction for the light source in
the horizontal and vertical plane, respectively. The default value for the horizontal slider is 0 degrees, the possible values ranging
from 0 to 360 degrees. The values for the vertical direction of the light source range from -180 to 180 degrees.

5.75.6 View Tab

The controls int the Zoom (%) group box can be used to define a global magnification for the 3D plot, as well as the aspect ratio
for the three axes of the plot.
The controls int the Rotation group box can be used to in order to set a custom rotation angle around any of the three axes X, Y
or Z. When pressing any of the push buttons from the Projection group box, QtiPlot automatically sets rotation angles that enable
a view of the XY, XZ or YZ planes. The View XY button, for example, displays a view from the top.
The controls from the Shift group box can be used to define the position of the plot with respect to the margins of the window
frame.
The QtiPlot Handbook 286 / 452

Figure 5.195: The general 3D plot view tab.

5.75.7 Stack Tab

The Stack tab is available when the plot contains only 3D curves created from tables. If the plot also contains surfaces, this tab is
no longer visible.

Figure 5.196: The general 3D plot stack tab.

The following stacking modes are available:

None: Curves are not stacked. This is the default mode.


The QtiPlot Handbook 287 / 452

Cumulative: Z values of 3D curves are stacked cumulatively. If the Normalize to Percent box is checked, the Z axis displays
percent values and the stack of curves sums to 100%.

5.75.8 Scale Tab

The scale tab is used to modify the X, Y, and Z ranges. It also allows specification of the number of labels (major ticks) to be
drawn on the axes, as well as the number of minor ticks and the first major tick.

Figure 5.197: The surface plot options dialog box.

5.75.9 Axis Title Tab

This tab can be used to define the titles of the three axes and their font. It is possible to enable/disable the display of the title by
checking/unchecking the Show box.
The push buttons bellow the text input box allow for easy insertion of subscripts, superscripts, greek characters, special symbols,
etc... in your text. The syntax for the formatting of the text is identical to that described for texts in 2D plots, see the detailed
explanations in the Text options dialog.
The QtiPlot Handbook 288 / 452

5.75.10 Axis Tab

The controls from the Format group box on the left side of this tab allow to customise the main parameters of the three axes:
their width and color, the type and length of the ticks. Tick length is defined in the same units as the axis range. If the graph
scales are changed, QtiPlot will re-calculate the length of the ticks.
The controls from the Show Labels group box on the right side of this tab allow to enable/disable the display of the major tick
labels and to customise their main properties: font, color, numeric format, distance to axis (gap), etc... It is also possible to define
a prefix and suffix for all tick labels.
In the case of the Y axis, there is an additional control available, the Display list box. It allows to select how the tick labels for
the Y axis are handled by QtiPlot if the plot contains XYY curves. There are five options available:

Values The labels display the numerical values.


Column name The labels display the column name of the Y source data sets.

Column comment The labels display the comments of the Y source columns.
Column long name The labels display the long name of the Y source columns.
Full dataset name The labels display the full name (TableName_ColName) of the Y source columns.

5.75.11 Grid Tab

This tab is used to customise the color, pen style and line width of both major and minor grid lines for each of the three axes X,
Y or Z.
The QtiPlot Handbook 289 / 452

5.75.12 Text Tab

This tab is used to define or modify a text in the 3D plot.


The push buttons bellow the text input box allow for easy insertion of subscripts, superscripts, greek characters, special symbols,
etc... in your text. The syntax for the formatting of the text is identical to that described for texts in 2D plots, see the detailed
explanations in the Text options dialog.

5.75.13 Position Tab

This tab can be used in order to define the position of a 3D text object, using pixel coordinates.
The QtiPlot Handbook 290 / 452

5.75.14 Legend Tab

Each text or color scale can be attached to a 3D legend object. This tab can be used in order to set the parent legend or to detach
the text/color scale from a legend object, if the Attach to option is set to None.

5.75.15 Color Scale Tab

The Color Scale tab is used to customize the appearance (color filling and border) of a 3D color scale object.
The color filling can be enabled/disabled using the Fill with Color check box. If enabled, the filling can be Horizontal (the lowest
color index is on left side) or Vertical (the lowest color index is on the bottom).
Each color scale can be attached to a 3D surface or can have its own color map. If the Attach to option is set to None, a new
Color Map tab is displayed allowing to customize the internal color map of the scale. By pressing the Fill with Color button,
QtiPlot opens this tab or, if the color scale is attached to a 3D surface, automatically selects this surface in the elements tree on
the left side of the dialog and opens the color map tab corresponding to this surface.
The QtiPlot Handbook 291 / 452

Figure 5.198: The 3D color scale tab.

5.75.16 Axis Tab

The controls from the Format group box allow to customise the main parameters of the axis: its position with respect to the color
bar, its color and line width, the distance to the color bar, calculated in pixels, using the Stand-off spin box, as well as the display
of a backbone line.
The Scale group box can be used in order to specify a step value for the axis division or the number of labels (major ticks) to be
drawn on the axis. It also allows specification of the number of minor ticks and the value of the first major tick.
The controls from the Ticks group box allow to customise the length of the ticks. Tick length is defined in the same units as the
axis range. If the graph scales are changed, QtiPlot will re-calculate the length of the ticks.
The Numbers group box, on the right side of the tab, allows to enable/disable the display of the major tick labels and to customize
their main properties: font, color and numeric format.
The QtiPlot Handbook 292 / 452

Figure 5.199: The 3D color scale axis tab.

5.75.17 Title Tab

The Title tab can be used in order to customize the title of a 3D color scale.
The push buttons bellow the text input box allow for easy insertion of subscripts, superscripts, greek characters, special symbols,
etc... in your text. The syntax for the formatting of the text is identical to that described for texts in 2D plots, see the detailed
explanations in the Text options dialog.

Figure 5.200: The 3D color scale title tab.


The QtiPlot Handbook 293 / 452

5.75.18 Geometry Tab

The Geometry tab is used to define the Position and Size of the color bar of a 3D color scale object, using pixel coordinates.

Figure 5.201: The 3D color scale geometry tab.

5.75.19 Legend Tab

Each color scale can be attached to a 3D legend object. This tab can be used in order to set the parent legend or to detach the
color scale from a legend, if the Attach to option is set to None.

Figure 5.202: The 3D legend tab.

5.75.20 Group Edit Tab

The Group Edit tab is used to enable/disable the display of a plot legend and its appearance.
The QtiPlot Handbook 294 / 452

Figure 5.203: The 3D legend tab.

5.75.21 Format Tab

The Format tab allows modification of the properties of the 3D curve/surface, like the color and linewidth of the mesh or the
style of the data symbols.
The Resolution option is more or less akin to a speed drawing mode, which can be very useful when working with large data
sets. Larger values of the Resolution option result in fewer data points being drawn on 3D plots, and therefore a higher drawing
speed. When Resolution is set to 1, all data points are drawn.

Format options for 3D surfaces.

Format options for 3D ribbons.


The QtiPlot Handbook 295 / 452

Format options for 3D bars.

Format options for 3D line and symbol curves.


The QtiPlot Handbook 296 / 452

5.75.22 Colors Tab

The Colors tab allows modification of the colors used for the 3D surfaces or symbols. The 3D curves/surfaces internally use a
linear color map in order to define the color scheme which is used to show Z-values.

If the Scale Colors box is checked, a Z value will be represented by a color defined as a linear interpolation between the adjacent
values in the color table.
It is possible to load or store a colormap from/to a XML file by pressing the Open file and Save buttons.
A click on the Level column header opens the Set Equidistant Levels dialog, which allows to quickly edit the color map levels by
specifying their total number and an intensity range.
A click on the Color column header opens the Gradient Fill dialog, which allows to quickly customize the colors in the map.
The Opacity slider can be used in order to modify the alpha channel of the color map from 0 % (totally transparent) to 100 %
(fully opaque). The opacity can be set for the Selected Curve only, or for all curves in the Window or for all curves from All
Windows, depending on the setting activated in the Apply to select box.

5.75.23 Projection Tab

The Projection tab is only available for 3D surfaces and ribbon plots and can be used in order to customise the aspect of the floor
projection.
The QtiPlot Handbook 297 / 452

By default, the floor projection of a 3D surface is disabled. One can enable a full 2D projection or only display the isolines. The
number of projected isolines can be customised using the input spin box.
The default floor plane is the Z plane that contains the minimum data vertex of each surface or ribbon. It is possible to change
this setting to either the zero plane, the Z plane that contains the maximum data vertex or a custom Z value.

5.75.24 Labels Tab

The Labels tab is used if you want labels displayed near each data point in a 3D curve. Options are provided to control the font,
color, rotation angle and position of these labels.

If the Custom option is selected in the Label Form list box, the user can define a custom format in the Format String text input
box that shows up. The format string may contain the following synthax specifiers: $(x), $(y) and $(z), as substitutes for the
abscissa, ordinate and height values of the curve data points. The display of the numeric values can be customised using the
following format specifiers:

*n Display n significant digits: $(y, *3), where y equals 1.1415, displays 1.14.
The QtiPlot Handbook 298 / 452

.n Display n decimal places: $(y, .3), where y equals 1.1415, displays 1.141.
E.n Display n decimal places in engineering format: $(y, E.3), where y equals 0.1415, displays 141.500m.
S.n Display n decimal places in upper case scientific format: $(y, S.3), where y equals 0.1415, displays 1.415E-01.

If no custom format specifiers are found, QtiPlot uses the values provided in the Format and Precision controls as default, in
order to display numeric values in custom labels.

5.75.25 Drop Lines Tab

The Drop Lines tab allows to enable the display of vertical lines, parallel to the Z axis, from each data point of a 3D curve, by
checking the Show box. This tab is only visible in the case of 3D curves having the plot style set to Line + Symbols or Ribbon.
For 3D surfaces this tab is not visible. The controls in the Show group box can be used in order to customize the color, style and
linewidth of the drop lines.

5.75.26 Geometry Tab

In the case of 3D curves having the plot style set to Ribbon, this tab can be used in order to customize the width of the ribbon.
The width is calculated in percentages of the Y axis length.

Geometry options for 3D ribbons.


The QtiPlot Handbook 299 / 452

In the case of 3D curves having the plot style set to Bars, this tab can be used in order to customize the shape of the bars. If the
Square box is checked, QtiPlot tries to keep the same size for the bars allong X and Y axes, otherwise it is possible to specify
different dimensions, using the Width X and Width Y sliders. The Width Top slider can be used in order to define the size of the
top plane of the bars with respect to the base plane.

Geometry options for 3D bars.

5.75.27 Normals Tab

In three dimensions, a surface normal, or simply normal, to a surface at point P is a vector perpendicular to the tangent plane of
the surface at P. The Normals tab is only available for 3D surfaces created from matrices or mathematical functions. It can be
used in order to enable/disable the display of the 3D normal vectors and to customise their appearance.

5.75.28 Offset Tab

The Offset tab is only visible in the case of 3D curves having the plot style set to Line + Symbols or Bars. It allows to add an
offset allong X and Y axes for each data point symbol.
The QtiPlot Handbook 300 / 452

Figure 5.204: The 3D bars/symbols offset tab.

5.75.29 Vector Tab

The Vector tab is used to enable/disable the display of 3D vectors and to customise their appearance.

Figure 5.205: The 3D Vector options tab.

5.76 Sorting Options

This dialog is activated by selecting the Analysis -> Sort Table command. It operates on all columns of the active table. You
have the option to sort the columns:

• separately: each column will be sorted independently in ascending or descending order


The QtiPlot Handbook 301 / 452

• together: the column selected as the leading column will be sorted into ascending or descending order. The other columns will
be sorted so as to keep the rows unchanged.

Figure 5.206: The Sorting Options Dialog.

5.77 Tex Equation Editor

This dialog is activated by selecting the Add Equation... command from the Graph menu. It can be used in order to add LaTeX
formatted equations to a 2D plot layer.

5.77.1 Text Tab

Figure 5.207: The Tex Equation Editor: using a rendering web service.

The markup equations are rendered using one of the following third party tools: CodeCogs, a web service which requires a
working internet connection, a locally installed LaTeX compiler or a built-in LateX parser, JKQTMathText.
The parsing web service, as well as the JKQTMathText parser, support only a limited subset of LaTeX instructions. Please note
that JKQTMathText accepts multi-line equations, see the example bellow:
$\left[-\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} + V(x)\right]$\\
$\Psi(x)=$\\
$\mathrm{i}\hbar\frac{\partial}{\partial t}\Psi(x)$
The QtiPlot Handbook 302 / 452

Figure 5.208: The Tex Equation Editor: using the built-in LaTeX parser.

The generation method using a local compiler allows for compilation of complete LaTeX documents and not just of equation
markup, so that you can fully customize the image output in terms of font size, text color and background color.

Figure 5.209: The Tex Equation Editor: compilation of complete LaTeX documents.

When using a locally installed LaTeX compiler there’s no need to enter document/equation environment commands since QtiPlot
automatically creates a temporary file which contains either the following hard-coded preamble:
\PassOptionsToPackage{usenames, dvipsnames}{xcolor}
\documentclass{standalone}
\usepackage{xcolor}
The QtiPlot Handbook 303 / 452

\pagestyle{empty}

or a custom preamble that is read from a user defined file path (since one might want to use particular LaTeX packages). The
preamble can be edited using the controls from the LaTeX Preamble tab.
The paths for both the LaTeX compiler and the custom preamble file can be set via the File Locations tab of the Preferences
dialog.
After the preamble, the following code is appended to the temporary .tex file:
\begin{document}
\color{colorName}
$text in the editor window$
\end{document}

The colorName can be any of the 19 predefined colors available in LaTeX: black, blue, brown, cyan, darkgray, gray, green,
lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow. It is also possible to use the 68 standard
colors known to dvips, since the automatically added preamble includes the xcolor package.
The Font list box can be used in order to select a size different of the default option (Normal, which corresponds to the LaTeX
\normalsize command). In this case QtiPlot automatically adds a font size instruction to the temporary .tex file. The
sizes available in the Font list box are: Tiny (\tiny), Small (\small), Normal (\normalsize), large (\large), Large
(\Large), LARGE (\LARGE), huge (\huge) and Huge (\Huge).
The font sizes in points corresponding to the above size instructions can be customized in the preamble file using, for example,
the code bellow:
\documentclass{article}
\makeatletter
\renewcommand\scriptsize{\@setfontsize\scriptsize{7}{8}}
\renewcommand\tiny{\@setfontsize\tiny{10}{15}}
\renewcommand\small{\@setfontsize\small{15}{20}}
\renewcommand\normalsize{\@setfontsize\normalsize{20}{30}}
\renewcommand\large{\@setfontsize\large{30}{40}}
\renewcommand\huge{\@setfontsize\huge{40}{50}}
\makeatother
\pagestyle{empty}

The Format list box can be used in order to select the format of the output image resulting after the compilation process. The
default option is DVI -> SVG (dvisvgm process). When selected, the DVI file created by the local LaTeX compiler is converted to
a SVG temporary image using the dvisvgm tool, which needs to be installed on your computer in the same folder as the LaTeX
compiler. This option has the great advantage that the equations are rendered as vectorial images, resulting in a very good quality
of the images you obtain when exporting 2D graphics.
Since the results provided by this method are not always perfect, a complementary method is provided: DVI -> PNG (dvipng
process), which uses dvipng in order to create a PNG output image. This option has the draw-back of a bad image quality
(rasterization) when exporting the 2D graphics to a vectorial image format file.
The third method available, PDF -> SVG (pdflatex + dvisvgm process), is the one that seems to provide the best rendering results.
It uses the pdflatex compiler, which must be installed on your computer in the same folder as the default LaTeX compiler, in
order to create a temporary PDF file. This file is afterwards converted to SVG, using dvisvgm, and is finaly rendered to screen as
a vectorial image.
The Preview check box can be used in order to enable or disable the visualisation of the rendered equation inside this dialog.

5.77.2 Frame Tab

This tab is used to define the shape, color, line style and thickness for the frame of an equation object. By default, an equation
has a black rectangle frame, the Shape being set to Rectangle.
The changes can be applied to the selected equation, to all equations in the plot layer, to all equation in the active window or to
all equation objects from all plot windows, depending on the selection in the Apply to... box.
It is also possible to define the current frame options as a default style for the frame of all future equations by pressing the Set As
Default button.
The QtiPlot Handbook 304 / 452

5.77.3 Geometry Tab

The Geometry tab is used to specify the position and the dimensions of the equation object. The coordinates can be set as a
function of the scale values displayed on the left (Y) and bottom (X) axes, or in pixels, by choosing the desired method from the
Unit pull-down list. Pixel coordinates are relative to the top-left corner of the layer which contains the equation.

5.77.4 LaTeX Preamble Tab

This tab can be used to define a custom LaTeX preamble or to edit the one automatically generated by QtiPlot. It is available
only when the LaTeX parser selected in the Text tab is a locally installed LaTeX compiler.
If a custom LaTeX preamble file is defined in the File Locations tab of the user preferences dialog, the path to that file is displayed
in the File line, which is read-only, and its content is displayed in the text editor bellow. Otherwise the File line is empty and the
hard-coded LaTeX preamble used by QtiPlot is displayed in the text editor panel. In the compilation process QtiPlot uses the text
from this editor panel as preamble. If the editor is empty, QtiPlot uses the hard-coded preamble bellow:
\PassOptionsToPackage{usenames, dvipsnames}{xcolor}
\documentclass{standalone}
\usepackage{xcolor}
\pagestyle{empty}

The default LaTeX preamble file can be changed using the Open File... button. By pressing the Save As... button, a file
dialog pops-up and the content of the text editor panel can be saved to a custom location, which automatically becomes the
default LaTeX preamble file. The Clear button removes the path to the LaTeX preamble file from the user preferences. It
does not clear the text editor.

Figure 5.210: The Tex Equation Editor: LaTeX preamble tab.

5.78 Text options

5.78.1 Text

This dialog can be opened using several different commands, such as the Title... command, or simply by double clicking on an
axis title in your plot. The Color, Font and Alignment commands allow the modification of the general settings of the text label.
You can also specify the distance between the label and the corresponding axis, using the Distance to axis box.
The QtiPlot Handbook 305 / 452

Figure 5.211: The axis title options dialog.

It is worth knowing that some HTML tags and ASCII codes are understood by QtiPlot, therefore you can use them in order to
display special symbols or get fancy color effects, like in the examples bellow. Please note that the font HTML tag also accepts
colors in the #RRGGBB notation:

<font color = #ff7300>&#9728;</font> Sunshine


<font color=red>red</font><font color=#00ff00>green</font><font color=blue>blue</font>
<span style=’font-family:Symbol’>t</span><sub>sat</sub>

Clicking on the button opens a dialog allowing to add a HTML font tag by selecting the desired custom RGB color from a
color grid.
The following slightly modified dialog is opened when you double click on texts/legends in your plot in order to customize them.
It also allows adding text boxes to a plot layer. When the text object is a legend (a listing of the curves plotted on the layer) the
curve symbols and lines are also drawn in the text box, in front of the curve names. In order to display the symbol of a curve and
the name of the data set, the following syntax is used: \l(1.2)%(1.2). In this example the first integer before the dot is the index
of the plot layer and the second value, the number 2, refers to the index of the curve. The index of the layer is optional, if not
specified, the parent layer is used.

Figure 5.212: The legend/text options dialog.

The % character is an alias for the name of the data set. By adding ",@C" or ",@L" to the number you can alternatively use
the name or comment of the dataset, e.g. \l(2)%(2,@C) will use the column name. Additionally, you can use "@W" to display
The QtiPlot Handbook 306 / 452

the table name and "@WL" for the table label. To display the contents of a specific cell of the source data table use %(curve
#,@L,col,row). If the col parameter is missing the y-column of the dataset is used.
It is possible to display the contents of a specific cell in a table or matrix window using the folowing syntax: %(name,col,row),
where name is the name of the window.
In the case of box charts the plot legend also supports the following syntax specifiers:

Format
charac- Description
ter(s)
B The box symbol.
W The symbol for the whiskers of the box chart.
MDL The median line of the box chart.
ML The mean line of the box chart.
Max The symbol for the maximum percentile point of the box chart.
P99 The symbol for the 99th percentile point of the box chart.
M The symbol for the mean percentile point of the box chart.
P1 The symbol for the 1st percentile point of the box chart.
Min The symbol for the minimum percentile point of the box chart.
D The symbol for the data points of the box chart.
O The symbol for the outlier points of the box chart.

Table 5.1: Syntax specifiers for the components of a box chart.

In order to define custom colors for different text strings, like the names of the datasets for example, it is possible to use the \cn()
escape sequence, where n is the index of the colors in the Indexed Colors list defined in the Curves tab of the Preferences dialog.

\l(1)\c1(%(1))
\l(2)\c2(%(2))

Clicking on the button opens a dialog allowing to add a \cn() escape sequence by selecting the desired color from a indexed
color list box.
If the curve is an analytical function and you have defined a custom comment for it, by default it is this comment that will be
displayed. In order to change this behavior you can use either "@D" to display the function title or "@X" for the analytical
expression of the function.
If the Auto-update box is checked, the legend is updated each time a curve is added or removed from the plot layer.
The TeX Output option specifies if LaTeX special characters should be escaped or not when exporting to .tex files. If the text
contains LaTeX syntax (like superscripts, subscripts, etc...) and you want them to be interpreted by the LaTeX compiler, you
should check this option.
By pressing the Set As Default button, all text format options will be saved to the user preferences and will be applied to new text
objects. The Apply to... button can be used to apply these format options to all text objects in the active plot layer, the current plot
window, or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the
Apply to... button.
The Opacity of the Background color can have a value between 0 (transparent background) and 255 (completely opaque back-
ground).
The text item can be modified in the text window. Several enhancements can be added to text:

• <sub>text</sub> will draw the text as subscripts. You can insert this sequence by clicking on the button.

• <sup>text</sup> will draw the text as superscripts. You can insert this sequence by clicking on the button.

• Clicking on the button, opens a dialog for selecting lower case Greek characters:
The QtiPlot Handbook 307 / 452

• Clicking on the button opens a dialog for selecting upper case Greek characters:

• Clicking on the integral symbol opens a dialog which allows selecting various mathematical symbols:
The QtiPlot Handbook 308 / 452

• Clicking on the arrow icon opens a dialog which allows selecting various arrow symbols:

• <b>text</b> will draw the text with bold characters. You can insert this sequence by clicking on the button.

• <i>text</i> will draw the text with italic characters. You can insert this sequence by clicking on the button.

• <u>text</u> will draw the text with underlined characters. You can insert this sequence by clicking on the button.

5.78.2 Frame

The controls in the Frame box can be used in order to define a frame around the text and to customise its options: shape, color,
line style and width.
The controls in the Margins box can be used in order to define custom margins around the text. The left and right margins as
well as the top and bottom margins have the same value.

Figure 5.213: The legend frame options tab.

By pressing the Set As Default button, all frame format options will be saved to the user preferences and will be applied to new
text objects.
The Apply to... button can be used to apply these format options to all legends in the active plot layer, the current plot window,
or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the Apply
to... button.
The QtiPlot Handbook 309 / 452

5.78.3 Symbol

The controls in the Symbol tab can be used in order to customise some of the properties of the symbols displayed for 2D plot
curves when translating code like \l(1).
The value displayed in the Length box represents the length of the lines that are drawn on each side of a data symbol for curves
having the plot style set to Scatter or Line + Symbols. For curves not displaying a data symbol, like histograms, bars or area
curves, this value simply represents the width of the rectangle drawn in the legend.
The line width of the symbol is equal, by default, to the the line width of the cooresponding 2D plot curve. By checking the
Custom box, it is possible to set a different value, displayed in the Thickness spin box.

Figure 5.214: The legend symbol options tab.

By pressing the Set As Default button, all frame format options will be saved to the user preferences and will be applied to new
text objects.
The Apply to... button can be used to apply these format options to all legends in the active plot layer, the current plot window,
or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the Apply
to... button.

5.79 Open Template Dialog

This dialog is activated by selecting the Open Template command from the File Menu.
It can be used in order to import an existing QtiPlot XML template file (.qwt) or the older template file formats: .qpt (2D graphs),
.qst (3D graphs), .qmt (matrices), .qtt (tables) as well as some OriginLab window template file formats: .otp (2D graphs) and
.otm (matrices).
The preview of the template file is only available for templates created with QtiPlot. The Preview check box is not available if
the .otp or .otm file formats are selected in the Format list.
The QtiPlot Handbook 310 / 452

Figure 5.215: Opening of a QtiPlot Window Template (.qwt) file.

5.80 Export ASCII Dialog

This dialog is activated by selecting the Export ASCII command from the File Menu. It is active if there is at least one table
window in the project.
This command is used to export all or a part of the data of a project to an ASCII file. Alternatively, you can also choose to export
the tables/matrices to one of the following formats: TeX (.tex), Open Document Format (.odf) or as web pages (.html).

Figure 5.216: Export of a selection from a table to an ASCII file.

The file Name as well as the Path where the data will be saved can be chosen by pressing the file system browsing buttons at the
right. They can also be edited manually. Please note that QtiPlot provides an auto-completion mechanism when editing the file
path.
The Endline character listbox can be used to select the end line character convention for the output ascii file. Possible values are:
line feed (LF), carriage return + line feed (CRLF) and carriage return only (CR, usually on Mac computers).
The names of the selected columns will be exported as the first line of the file if the Include Column Names option is checked.
When this option is left unchecked, any column names will be ignored and the names "C1", "C2",... will be used in the exported
The QtiPlot Handbook 311 / 452

file. If the Include Column Comments option is also checked, the comments displayed in the table header are exported as the
second line of the file. If the Export Selection option is checked, only the selected columns will be exported.
The formatting of the numbers in each table column is preserved during the export. Make sure that adequate precision has been
set before exporting to insure that the ASCII representation of the numbers in the output file is sufficiently accurate.

5.81 Import ASCII files

This dialog is activated by selecting the Import -> Import ASCII... command from the File Menu. The files are imported using a
set of default options. All your changes to the default import parameters will be saved.
The file Name as well as the Path of the files to be imported can be chosen by pressing the file system browsing buttons at the
right. They can also be edited manually. Please note that QtiPlot provides an auto-completion mechanism when editing the file
path.
This dialog can be used to import one or several ASCII files at the same time (their names must be separated by commas). If
multiple files are imported simultaneously and any of the names in the list contain the comma character, the file names must be
enclosed in double quotes in order to be able to correctly perform the parsing of the file names. QtiPlot automatically adds the
double quotes when you select the files to be imported using the file system browsing button.

Figure 5.217: The dialog box.

You can define a custom file filter in the Format field in order to preselect files. For example, typing *.mydata will set a filter that
will show only files of the form "XXX.mydata" in the file selection dialog.
Concerning the character which is used to separate column values, you must bear in mind that there is no grouping of separators,
so if you use "SPACE", you must use only one separator between each column or check the Simplify white spaces option.
If your data files have a particular structure, for example if they begin with several lines describing your experiment, you may
skip the first n lines of the file. You can also skip all lines starting with a comment character/string. The comment string can be
customized using the Ignore lines starting with text edit box.
If you choose to use the first line to define column names and/or the second line as comments to be displayed in the table header,
you must use the same separator between column names as that used between data columns.
The QtiPlot Handbook 312 / 452

If the files you want to import were created using a different convention for the decimal and thousands separator characters
than the current setting, then the Decimal Separators option can be used to configure QtiPlot to use a matching convention.
For example, when a comma character is used for the decimal point instead of the dot character, simply change the Decimal
Separators option to match. You can have QtiPlot ignore the Thousands separator altogether with the Omit thousands separator
option.
Finally, you can specify the kind of data to be imported in each column by pressing the Column Types... button or by double-
clicking on the column header in the preview table. A dialog will pop-up allowing you to choose a data type (the default data
type for each column is Text & Numeric) and a column format in the case of date/time columns.
The format string may be chosen from the list of predefined formats or may be edited in order to fit your particular data format.
In this format string the following placeholders are recognized, all other input characters being treated as text:

d the day as number without a leading zero (1 to 31)


dd the day as number with a leading zero (01 to 31)

ddd the abbreviated localized day name (e.g. ’Mon’ to ’Sun’)


dddd the long localized day name (e.g. ’Monday’ to ’Sunday’)
M the month as number without a leading zero (1-12)
MM the month as number with a leading zero (01-12)

MMM the abbreviated localized month name (e.g. ’Jan’ to ’Dec’)


MMMM the long localized month name (e.g. ’January’ to ’December’)
yy the year as two digit number (00-99)

yyyy the year as four digit number


h the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
hh the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
H the hour without a leading zero (0 to 23, even with AM/PM display)

HH the hour with a leading zero (00 to 23, even with AM/PM display)
m the minute without a leading zero (0 to 59)
mm the minute with a leading zero (00 to 59)

s the second without a leading zero (0 to 59)


ss the second with a leading zero (00 to 59)
z the milliseconds without leading zeroes (0 to 999)
zzz the milliseconds with leading zeroes (000 to 999)

AP or A interpret as an AM/PM time. AP must be either "AM" or "PM".


ap or a interpret as an AM/PM time. ap must be either "am" or "pm".
The QtiPlot Handbook 313 / 452

5.82 Convert files

This dialog is activated by selecting the Convert files... command from the File Menu. It can be used to convert single or all
*.opju files from the folder specified in the Path edit line, if the box All is checked, to the .opj file format.

Figure 5.218: Convert OPJU files dialog.

The *.opju file format, introduced in Origin 2018 can only be imported by QtiPlot on Windows, provided that a recent OriginLab
version is installed on your computer (even as an evaluation or demo version). In this case QtiPlot can use the COM interface
installed by OriginLab in order to convert the .opju files to the older .opj file format, which, afterwards, can be imported directly
by QtiPlot, also on other operating systems than Windows, like macOS or Linux.

5.83 Import database

This dialog is activated by selecting the File -> Import -> Database... command. The dialog allows to choose the tables/views to
be imported from a database. You have the possibility to import individual tables or all tables at once by checking the box All. If
the New Folder option is checked the imported tables are moved into a subfolder inside the current folder of your project. The
name of this subfolder is generated automatically based on the name of the database.
If you choose to import an SQL database (MySQL, PostgreSQL or SQLite) or a Microsoft Access database on a Windows
system, it is also possible to perform an SQL query on the database, prior to the import operation:

Figure 5.219: SQL database table/view selection with query dialog.

On Linux or macOS systems it is not possible to perform an SQL query when importing Microsoft Access databases (.mdb).
The QtiPlot Handbook 314 / 452

Figure 5.220: Database table/view selection dialog on Linux and macOS systems.

5.84 Open Matlab File

This dialog is opened by selecting the Import -> Matlab... command from the File -> Import submenu and allows total control
over the process of importing Matlab format files (*.mat).
The controls in the upper side of the dialog provide basic information about the file being imported: its location (displayed in the
Path label) and its size (displayed in the corresponding Size label).
The dialog also displays the structure of the Matlab file in a tree widget allowing the selection of the variables to be imported.
The import of a variable can be also enabled/disabled by right-clicking on the name of a variable and selecting the Import option
from the pop-up menu. The All check box allows to quickly toggle/untoggle the import of all variables from the Matlab file.
A double-click on the name of a variable opens an information message box displaing the number of rows and columns in this
variable toghether with its data type. The list of properties can also be displayed by right-clicking on the name of a variable and
selecting the Properties option from the pop-up menu.
QtiPlot creates a new table for each variable imported from the Matlab file. By checking the New Folder box these tables are
moved into a subfolder inside the current folder of your project. The name of the new subfolder is generated automatically based
on the name of the Matlab file.

Figure 5.221: The Open Matlab File dialog box.


The QtiPlot Handbook 315 / 452

Figure 5.222: The Matlab variable properties dialog.

5.85 Open TDMS File

This dialog is opened by selecting the Import -> NI (TDMS)... command from the File -> Import submenu and allows total
control over the process of importing NI TDMS format files (*.tdms).
The controls in the upper side of the dialog provide basic information about the file being imported: its location (displayed in the
Path label) and its size (displayed in the corresponding Size label).
The dialog also displays the structure of the TDMS file in a tree widget allowing the selection of the groups and channels to be
imported. It is possible to enable/disable the import of an entire group or of individual channels by checking/unchecking the
corresponding box situated on the right side of the selection tree. The same result can be achieved by right-clicking on the name
of a group or channel and selecting the Import option from the pop-up menu.
A double-click on the name of a channel opens an information message box displaing the number of data values in this channel
toghether with the list of its properties. The list of properties can also be displayed by right-clicking on the name of a channel
and selecting the Properties option from the pop-up menu.
If the Preview box is checked QtiPlot displays a plot of the raw data values stored in the currently selected channel. The selection
of the channels can be done either with the mouse or using the up and down arrow keys. The preview image is not available for
channels containing strings or time stamps. If the raw data values have a complex type only the real part of the data is displayed
by the preview plot.
Checking the Preview box also enables an input box that allows to limit the number of raw data values visible in the preview plot.
By default this limit is set to one million. Choosing a limit lower than two automatically displays all data.
QtiPlot creates a new table for each group imported from the TDMS file. By checking the New Folder box these tables are moved
into a subfolder inside the current folder of your project. The name of the new subfolder is generated automatically based on the
name of the TDMS file.
The QtiPlot Handbook 316 / 452

Figure 5.223: The Open TDMS File dialog box.

The All check box allows to quickly toggle/untoggle the import of all channels from the TDMS file.
The QtiPlot Handbook 317 / 452

Figure 5.224: The TDMS channel properties dialog.


The QtiPlot Handbook 318 / 452

Chapter 6

Analysis of data and curves

6.1 Fast Fourier Transform

This function is accessed with the FFT... command, which is located in the Analysis Menu whenever a table or a plot is selected.
The Fourier transform decomposes a signal into its elementary components by assuming that the signal x(t) can be described as
a sum:

E QUATION 6.1: Fourier equation

in which are the frequencies, an are the amplitudes of each frequency and are the phases of each frequency. QtiPlot will
compute these parameters and build a new plot of the amplitude as a function of frequency.

This FFT was performed on a curve to extract it’s characteristic frequency components. The original signal is on the bottom
plot, while the amplitude-frequency plot is on the top layer. In this example, the amplitude curve has been normalized, and the
frequencies have been shifted to obtain a centered x-scale.

Figure 6.1: An example of the FFT.


The QtiPlot Handbook 319 / 452

The important parameters of the FFT can be modified using the FFT dialog, including the selection of an inverse FFT. An inverse
FFT performed on the results of a forward FFT should result in the original signal. Frequently, it is useful to remove or modify
some of the frequency components before the inverse FFT is performed. This may be particularly useful when it is desirable to
remove some known interference. A common example would be the removal of power-line interference (usually 50 or 60 Hz,
depending upon where you live). You should remember that this will also remove any real portions of the signal that happen to
be at that same frequency. Care should be used when doing this.

6.2 Correlation

This function is accessed with the Correlate command. It is located in the Analysis Menu whenever a table is selected. The
correlation function, also known as the covariance function, is used to test the similarity of two signals x(t) and y(t). It is
computed as:

E QUATION 6.2: Covariance function of two signals x(t) and y(t)

in which and are the mean values of the signals x(t) and y(t), respectively.
If the number of points is N, the function will be computed between -N/2 and N/2. The abscissae are therefore point indexes and
not t values.
The QtiPlot Handbook 320 / 452

The first plot shows the two signals, the second one is the correlation function between the two signal which shows that there are
correlations, and the third one is the Fourier transform which is done to extract the characteristic frequencies of the correlation

function.

Figure 6.2: An example of a correlation between two sine functions.

The correlation of a signal with itself can also be performed and is frequently used in spectral analysis (it is then called autocor-
relation or autocovariance function).

6.3 Convolution

In mathematics convolution is an operation on two functions to produce a third function that expresses how the shape of one is
modified by the other. The term convolution refers to both the result function and to the process of computing it. A discrete
convolution can be defined for functions on the set of integers. For more details, please visit the the Wikipedia section dedicated
to the convolution.
The algorithm used in QtiPlot is based on the fast Fourier transform (FFT) via the circular convolution theorem. Specifically, the
circular convolution of two finite-length sequences (signal and response data sets) is found by computing an FFT of each data
set, multiplying them pointwise, and then performing an inverse FFT.
The QtiPlot Handbook 321 / 452

6.4 Deconvolution

Computing the inverse of the convolution operation is known as deconvolution. For more details, please visit the the Wikipedia
section dedicated to the deconvolution.

6.5 Data Fitting

The aim of data fitting is to estimate the parameters which best describe experimental data (the response values yi ).

6.5.1 Fitting algorithms

QtiPlot uses least-squares algorithms for linear and nonlinear fitting of experimental data. For nonlinear fitting the following
iterative algorithms are provided:

1. the Levenberg-Marquardt algorithm


2. the Nelder-Mead algorithm (or downhill simplex method)

6.5.2 Weighted data fitting

QtiPlot provides several methods in order to calculate the weighting coefficients, wi , for the experimental data. In all cases,
for both linear and nonlinear fitting, the least-squares algorithms available in QtiPlot support only Y weights. Even if data sets
defined as X error bars are used as weighting coefficients, the fitting algorithms will still treat them as Y weights.

6.5.3 Goodness-of-Fit Statistics

After performing a data fit operation, a series of fit statistics are displayed in the log window allowing evaluation of the goodness
of fit. The default fit statistics to be displayed can be customized via the Fitting page of the Preferences dialog.

Figure 6.3: The results shown in the log window after a data fit operation.
The QtiPlot Handbook 322 / 452

The statistic values that QtiPlot can calculate are:

1. N:
the number of response values yi (i.e. data points in the analysed curve/data set).
2. Degrees of Freedom (doF):
defined as the number of response values minus the number of fitted coefficients estimated from these response values: n -
p.
3. RSS (Residual Sum of Squares):
is the sum of squares of residuals. This statistic measures the total deviation of the response values from the fit to the
response values. It is also called the Sum of Squares due to Error (SSE) or chi-square (Chiˆ2). A small RSS indicates a
tight fit of the model to the data.
4. Chiˆ2/doF:
The reduced chi-square is obtained by dividing the residual sum of squares (RSS) by the degrees of freedom (doF).
Although this is the quantity that is minized during the iterative process, it is typically not a good measure for the goodness
of fit. For example, if the y data is multiplied by a scaling factor, the reduced chi-square will be scaled as well.

5. R-square:
is defined as 1 - RSS/TSS, where TSS is the total sum of squares:

with

being the mean of the response values.


In the case of weighted data fitting, the total sum of squares is calculated as:

where wi are the weighting coefficients of the response values. This formula uses a correction factor, the mean of the
response values being replaced by a weighted mean. Please note that up to release 1.0.0-rc3 QtiPlot used the unweighted
mean for the calculation of the total sum of squares.
The R-square statistic measures how successful the fit is in explaining the variation of the data. Put another way, R-square
is the square of the correlation between the response values and the predicted response values. It is also called the square
of the multiple correlation coefficient and the coefficient of multiple determination.
R-square can take on any value between 0 and 1, with a value closer to 1 indicating that a greater proportion of variance
is accounted for by the model. For example, an R-square value of 0.8234 means that the fit explains 82.34% of the total
variation in the data about the average.
If you increase the number of fitted coefficients in your model, R-square will increase although the fit may not improve
in a practical sense. To avoid this situation, you should use the degrees of freedom adjusted R-square statistic described
below.
Note that it is possible to get a negative R-square for equations that do not contain a constant term. Because R-square is
defined as the proportion of variance explained by the fit, if the fit is actually worse than just fitting a horizontal line then
R-square is negative. In this case, R-square cannot be interpreted as the square of a correlation. Such situations indicate
that a constant term should be added to the model.

6. R:
is calculated as the square root of R-square
The QtiPlot Handbook 323 / 452

7. Adjusted R-square:
is defined as 1 - RSS*(n - 1)/(doF*TSS)
The adjusted R-square statistic is generally the best indicator of the fit quality when you compare two models that are
nested - that is, a series of models each of which adds additional coefficients to the previous model. The adjusted R-square
statistic can take on any value less than or equal to 1, with a value closer to 1 indicating a better fit. Negative values can
occur when the model contains terms that do not help to predict the response.
8. RMSE (Root Mean Squared Error):
is calculated as the square root of the reduced Chi-square
RMSE = [Chi2 /(n - p)]1/2
This statistic is also known as the fit standard error and the standard error of the regression. It is an estimate of the standard
deviation of the random component in the data and is defined as the square root of RSS divided by the degrees of freedom.
Just as with RSS, an RMSE value closer to 0 indicates a fit that is more useful for prediction.

The detailed explanations about the meaning of these statistical values were taken from: http://web.maths.unsw.edu.au/~adelle/-
Garvan/Assays/GoodnessOfFit.html

6.5.4 Confidence interval for the fit parameters

For each of the p fit parameters, β j , a confidence interval can be calculated using the formulas bellow:
UCL = β j + t(1-α/2,n-p) ε j
LCL = β j - t(1-α/2,n-p) ε j
where UCL is the Upper Confidence Limit, LCL is the Lower Confidence Limit, t(1-α/2,n-p) is the 100(1 - α/2) percentage point
of Student’s t distribution on n - p degrees of freedom, n is the number of data points and ε j is the standard error for the j-th
parameter, calculated from the corresponding diagonal element of the covariance matrix Cov(j, j) as explained in the Reported
errors section of the chapter dedicated to the fit wizard.

6.5.5 Confidence bands

In the case of unweighted data fitting, the confidence interval around a predicted response Ŷi at a particular abscissa Xi is
calculated as:
Yi = Ŷi ± t(1-α/2,n-p) S[1/n + (Xi - Xm )2 /Sxx]1/2
where t(1-α/2,n-p) is the 100(1 - α/2) percentage point of Student’s t distribution on n - p degrees of freedom, n is the number of
data points, S is the Root Mean Squared Error (RMSE), Xm = ∑Xi /n is the mean of the abscissas of the data points and Sxx =
∑(Xi - Xm )2 .
For weighted data fitting, the prediction interval around a predicted response Ŷi at a particular abscissa Xi is calculated as:
Yi = Ŷi ± t(1-α/2,n-p) Sw [1/∑wi + (Xi - Xmw )2 /Sxxw ]1/2
where Sw is the weighted Root Mean Squared Error (RMSE), Sxxw = ∑wi (Xi - Xmw )2 and the weighted mean of the abscissas is
defined as Xmw = ∑wi Xi /∑wi .

6.5.6 Prediction bands

In the case of unweighted data fitting, the prediction interval around a predicted response Ŷi at a particular abscissa Xi is
calculated as:
Yi = Ŷi ± t(1-α/2,n-p) S[1 + 1/n + (Xi - Xm )2 /Sxx]1/2
where t(1-α/2,n-p) is the 100(1 - α/2) percentage point of Student’s t distribution on n - p degrees of freedom, n is the number of
data points, S is the Root Mean Squared Error (RMSE), Xm = ∑Xi /n is the mean of the abscissas of the data points and Sxx =
∑(Xi - Xm )2 .
The QtiPlot Handbook 324 / 452

For weighted data fitting, the prediction interval around a predicted response Ŷi at a particular abscissa Xi is calculated as:
Yi = Ŷi ± t(1-α/2,n-p) Sw [1 + 1/∑wi + (Xi - Xmw )2 /Sxxw ]1/2
where Sw is the weighted Root Mean Squared Error (RMSE), Sxxw = ∑wi (Xi - Xmw )2 and the weighted mean of the abscissas is
defined as Xmw = ∑wi Xi /∑wi .
For more explanations about the formulas for the confidence and prediction intervals, please read the article Weighted Least-
Squares Approach To Calculating Limits of Detection and Quantification by Modeling Variability as a Function of Concentration
by Michael E. Zorn, Robert D. Gibbons, and William C. Sonzogni.

6.6 Fitting to specific curves

QtiPlot includes quick access to the most useful functions for fitting.

6.6.1 Fitting to a line

This command is used to fit a curve which has a linear shape.

Figure 6.4: The results of a Fit Linear (Default).

The results will be given in the Log panel:


The QtiPlot Handbook 325 / 452

6.6.2 Fitting to a polynomial

This command is used to fit a polynomial function to data which has a curvilinear shape. It opens the Polynomial Fit Options
dialog, allowing you to choose the curve to fit, the order of the polynomial function to use, the number of points of the resulting
curve and the abscissa limits for the fit.
The results of the fit are displayed in the Log panel.

Figure 6.5: The results of Fit Polynomial....

6.6.3 Fitting to a Boltzmann function

This command is used to fit a curve which has a sigmoidal shape. The function used is:

E QUATION 6.3: Boltzmann equation

in which A1 is the low Y limit, A2 is the high Y limit, x0 is the inflexion (half amplitude) point and dx is the width.
The QtiPlot Handbook 326 / 452

Figure 6.6: The results of Fit Boltzmann (sigmoidal).

6.6.4 Fitting to a Logistic function

This command can be used to fit a curve which has a sigmoidal shape. The function used is:

E QUATION 6.4: Logistic dose response equation

where A1 is the initial Y value, A2 is the final Y value, x0 is the inflexion point (center) and p is the power.
The QtiPlot Handbook 327 / 452

Figure 6.7: The results of Fit Logistic compared to Fit Boltzmann (sigmoidal).

6.6.5 Fitting to a Gauss function

This command is used to fit a curve which has a bell shape. The function used is:

E QUATION 6.5: Gauss equation

in which A is the height, w is the width, xc is the center and y0 is the Y-values offset.
The QtiPlot Handbook 328 / 452

Figure 6.8: The results of Fit Gaussian.

6.6.6 Fitting to a Lorentz function

This command is used to fit a curve which has a bell shape. The function used is:

E QUATION 6.6: Lorentz equation

in which A is the area, w is the width, xc is the center and y0 is the Y-values offset.
The QtiPlot Handbook 329 / 452

Figure 6.9: The results of Fit Lorentzian.

6.6.7 Fitting to a PsdVoigt1 function

This command is used to fit a curve with a Pseudo-Voigt function which is a linear combination of Gaussian and Lorentzian
functions:

E QUATION 6.7: PsdVoigt1 equation

The parameters of the PsdVoigt1 function have the following meaning: y0 is the Y-values offset, A is the area, w is the width
(FWHM), xc is the center and mu is a profile shape factor.

6.6.8 Fitting to a PsdVoigt2 function

This command is used to fit a curve with a Pseudo-Voigt function which is a linear combination of Gaussian and Lorentzian
functions with different FWHM:

E QUATION 6.8: PsdVoigt2 equation

The parameters of the PsdVoigt2 function have the following meaning: y0 is the Y-values offset, A is the area, wG is the Gaussian
FWHM, wL is the Lorentzian FWHM, xc is the center and mu is a profile shape factor.
The QtiPlot Handbook 330 / 452

Figure 6.10: The results of Fit Pseudo-Voigt -> PsdVoigt2....

6.7 User defined fit models

Using the Fit Wizard it is possible to define your own fit model. This example shows the results of a non-linear fit using a custom
modified Gauss function with the offset term y0 set to zero.
The QtiPlot Handbook 331 / 452

Figure 6.11: The results of a non-linear fit using a custom Gauss function: y(x) = A*exp(-(x-xc)ˆ2/(2*wˆ2)).

6.8 Multi-Peaks fitting

This kind of fitting allows to fit your data points to a sum of Gaussian, Lorentzian or Pseudo-Voigt functions.

Figure 6.12: The results of a Fit Multi-peak -> Lorentzian....

The first step is to specify the number of peaks. Then you must define the position of each peak on the curve. This is done by
clicking on the plot, then validate your choice for each peak with the ENTER key.
When the selection step ends QtiPlot pops-up a dialog that summarizes the positions of the peaks and lets you choose if you
perform the fit using these parameters or if you want to open the Fit Wizard and refine the initial guesses before performing the
fit.
The QtiPlot Handbook 332 / 452

Figure 6.13: Information dialog allowing to launch the Fit Wizard.

6.9 Multiple Linear Regression Model

Linear regression is a linear approach to modeling the relationship between a scalar response (or dependent variable) and one
or more independent variables. The case of one independent variable is called simple linear regression. For more than one
independent variable, the process is called multiple linear regression.
Given a data set {yi , xi1 , ..., xip } where i = 1,...,n, a linear regression model assumes that the relationship between the dependent
variable y and the p-vector of regressors x is linear. This relationship is modeled through a disturbance term or error variable ε
- an unobserved random variable that adds noise to the linear relationship between the dependent variable and regressors. Thus
the model takes the form:
yi = β 0 + β 1 xi1 +...+ β p xip + ε i = xi T + ε i , i = 1,...,n
where β 0 is the y-intercept, T is the transpose operator and xi T ε is the inner product between vectors xi and ε. These n equations
can be written together in matrix notation as:
Y = Xβ + ε
This system of equations can be solved using the singular value decomposition (SVD) algorithm. The routine used in QtiPlot is
adapted from svdecomp.c in XLISP-STAT 2.1 by Luke Tierney and David Betz.

6.10 Filtering of data curves

In this section, it will be assumed that you have the following data curve:
The QtiPlot Handbook 333 / 452

This signal has a power spectrum which contains both high and low frequencies. We can analyze this by doing a FFT on the data
curve, this leads to the following figure:

The next sections will show the influence of the different filters on this data curve.

6.10.1 FFT low pass filter

This filter cuts high frequencies from a signal. You just have to select the cut-off frequency of the filter. Let us assume that we
want to keep the frequencies below 1 Hz, we will obtain:

Figure 6.14: Signal after a FFT low pass filter


The QtiPlot Handbook 334 / 452

The power spectrum of this new signal shows that the frequencies below 1 Hz.

6.10.2 FFT high pass filter

This filter cuts low frequencies from a signal. You just have to select the cut-off frequency of the filter. Let us assume that we
want to keep the frequencies above 1 Hz, we will obtain:

Figure 6.15: Signal after a FFT high pass filter

The power spectrum of this new signal shows that the frequencies above 1 Hz remain.
The QtiPlot Handbook 335 / 452

6.10.3 FFT band pass filter

This filter cuts both low and high frequencies from a signal while leaving frequencies in the pass band. You just have to select
the high and low cut-off frequencies of the filter. Let us assume that we want to keep the frequencies between 1.5 and 3.5 Hz, we
will obtain:

Figure 6.16: Signal after a FFT band pass filter

The power spectrum of this new signal shows that only frequencies in the pass band remain (2 and 3 Hz).
The QtiPlot Handbook 336 / 452

6.10.4 FFT block band filter

This filter keeps the low and high frequencies in a signal while cutting frequencies in the stop band. You just have to select the
high and low cut-off frequencies of the filter. Let us assume that we want to remove the frequencies between 1.5 and 3.5 Hz, we
will obtain:

Figure 6.17: Signal after a FFT block band filter

The power spectrum of this new signal shows that only the frequencies below 1.5 Hz and above 3.5 Hz remain.
The QtiPlot Handbook 337 / 452

6.11 Interpolation

The interpolation command will create a new data curve with a high number of points generated by interpolation of your data.
The dialog box allows you to define the number of output data points (default value is 1000), the method used for interpolation,
the interval of X-values to interpolate over and the color of the interpolated curve. In addition to the new curve in the active plot,
a new table will be created containing the data for the curve.

Three interpolation methods are available. The first is a linear method. In this case, interpolated data points are placed along the
straight between every two adjacent values of your data. The second is the method of natural cubic splines. The word "natural"
meaning that the second derivatives of the spline polynomials are set equal to zero at the endpoints of the interval of interpolation.
The last method, Akima, is a polynomial interpolation that requires a minimum of five data points in the curve to be interpolated.
Please note that using these interpolation methods it is also posible to extrapolate values bellow Xmin (linear and cubic methods
only) and beyond Xmax for all three methods.
The QtiPlot Handbook 338 / 452

Figure 6.18: Comparison of the three methods of interpolation


The QtiPlot Handbook 339 / 452

Chapter 7

Mathematical Expressions and Scripting

QtiPlot supports two different interpreters for evaluating mathematical expressions and for executing scripts: muParser and
Python. muParser can be only used for the evaluation of mathematical expressions, whereas Python can be used to execute scrips.
The default interpreter is muParser therefore if you want to execute scripts you should first enable the Python scripting engine
via the Scripting language dialog. Also, you can define the default scripting interpreter via the General tab of the Preferences
dialog.

7.1 muParser

The constants _e=e=E and _pi=pi=PI=Pi are defined, as well as the following fundamental physical constants, operators and
functions. Please note that the fundamental constants cannot be redefined. Doing so will raise an error message. The values of
the physical constants listed bellow are defined using the standard MKSA unit system (meters, kilograms, seconds, amperes):

Name Description
c The speed of light in vacuum
eV The energy of 1 electron volt
g The standard gravitational acceleration on Earth
G The gravitational constant
h Planck’s constant
hbar Planck’s constant divided by 2 pi
k The Boltzmann constant
Na Avogadro’s number
R0 The molar gas constant
V0 The standard gas volume
Ry The Rydberg constant, in units of energy

Table 7.1: muParser: Predefined Fundamental Physical Constants in the standard MKSA unit system

7.2 Python

This module provides bindings to the Python programming language. Basic usage in the context of QtiPlot will be discussed
below, but for more in-depth information on the language itself, please refer to its excellent documentation.

7.2.1 The Initialization File

The qtiplotrc.py file allows you to customize the Python environment, import modules and define functions and classes that
will be available in all of your projects. If QtiPlot was built using Qt 4 library, the name of the default initialization file is
The QtiPlot Handbook 340 / 452

Name Description
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus operator (returns the remainder of a when divided by b)
ˆ Exponentiation (raise a to the power of b)
< less than (returns 0 or 1)
<= less than or equal (returns 0 or 1)
== equal (returns 0 or 1)
>= greater than or equal (returns 0 or 1)
> greater than (returns 0 or 1)
!= not equal (returns 0 or 1)
?: if-then-else operator: condition ? return value if true : return value if false.

Table 7.2: muParser: Supported Mathematical Operators

qtiplotrc_qt4.py.
The default initialization file shipped with QtiPlot imports Python’s standard math functions as well as (if available) special
functions from SciPy, the symbolic mathematics library SymPy and helper functions for RPy2. Also, it creates some handy
shortcuts, like table("table1") for qti.app.table("table1").
When activating Python support, QtiPlot searches the initialization file in a default folder, which can be customized via the File
Locations tab of the Preferences dialog. If the initialization file is not found, QtiPlot will issue a warning and muParser will be
kept as the default interpreter.
Files ending in .pyc are compiled versions of the .py source files and therefore load a bit faster. The compiled version will be used
if the source file is older or nonexistent. Otherwise, QtiPlot will try to compile the source file (if you’ve got write permissions
for the output file).

7.2.2 Python Basics

Mathematical expressions work largely as expected. However, there’s one caveat, especially when switching from muParser
(which has been used exclusively in previous versions of QtiPlot): aˆb does not mean "raise a to the power of b" but rather
"bitwise exclusive or of a and b"; Python’s power operator is **. Thus:
2^3 # read: 10 xor 11 = 01
#> 1
2**3
#> 8

One thing you have to know when working with Python is that indentation is very important. It is used for grouping (most other
languages use either braces or keywords like do...end for this). For example,
x=23
for i in (1,4,5):
x=i**2
print(x)

will do what you would expect: it prints out the numbers 1, 16 and 25; each on a line of its own. Deleting just a bit of space will
change the functionality of your program:
x=23
for i in (1,4,5):
x=i**2
print(x)
The QtiPlot Handbook 341 / 452

Name Description
abs(x) absolute value of x
acos(x) inverse cosine
acosh(x) inverse hyperbolic cosine
asin(x) inverse sine
asinh(x) inverse hyperbolic sine
atan(x) inverse tangent
atanh(x) inverse hyperbolic tangent
avg(x1,x2,x3,...) average value, this command accept a list of arguments separated by commas
bessel_j0(x) Regular cylindrical Bessel function of zeroth order, J0 (x).
bessel_j1(x) Regular cylindrical Bessel function of first order, J1 (x).
bessel_jn(x,n) Regular cylindrical Bessel function of nth order, Jn (x).
bessel_y0(x) Irregular cylindrical Bessel function of zeroth order, Y0 (x) for x>0.
bessel_y1(x) Irregular cylindrical Bessel function of first order, Y1 (x) for x>0.
bessel_yn(x,n) Irregular cylindrical Bessel function of nth order, Yn (x) for x>0.
beta (a,b) Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0 and b > 0.
cos(x) cosine of x
cosh(x) hyperbolic cosine of x
erf(x) error function of x
erfc(x) Complementary error function erfc(x) = 1 - erf(x).
erfz(x) The Gaussian probability density function Z(x).
erfq(x) The upper tail of the Gaussian probability function Q(x).
exp(x) Exponential function: e raised to the power of x.
gamma(x) Computes the Gamma function, subject to x not being a negative integer
Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0,
gammaln(x)
log(|Gamma(x)|) is returned.
hazard(x) Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x).
ln(x) natural (base e) logarithm of x
log(x) natural (base e) logarithm of x
log10(x) decimal (base 10) logarithm of x
log2(x) base 2 logarithm of x
min(x1,x2,x3,...) Minimum of the list of arguments
max(x1,x2,x3,...) Maximum of the list of arguments
rint(x) Round to nearest integer.
sign(x) Sign function: -1 if x<0; 1 if x>0.
sin(x) sine of x
sinh(x) hyperbolic sine of x
sqrt(x) square root of x
tan(x) tangent of x
tanh(x) hyperbolic tangent of x

Table 7.3: muParser: Mathematical Functions


The QtiPlot Handbook 342 / 452

Name Description
In the context of a matrix, returns the value at row a and column b. In the context of a table, returns the value
cell(a,b)
at column a and row b (remember that tables use column logic). Everywhere else, this function is undefined.
Only works in the context of a table. Returns the value at column c and row i (the current row) in the context
col(c)
table. c can either be the column’s number, or its name in doublequotes.
if e1 is true, e2 is executed else e3 is executed. The evaluation of e1, e2 and e3 must return numerical values
if(e1,e2,e3)
only. Strings of characters are not accepted.
Only works in the context of a table. Returns the value at column c and row i (the current row) in the table t.
tablecol(t,c)
t is the table’s name in doublequotes, c is either the column’s number or its name in doublequotes.
derivative(yCol,
Calculates the derivative of column with index yCol with respect to column with index xCol from the current
xCol, row) table.
Takes a column name y, in doublequotes, and the corresponding abscissae stored in the column with index i
interp(y,i,x) from the same data table and linearly interpolates an ordinate at a given abscissa x. Only works in the context
of a table.
The average of all cells from row i to j in column with name n (in doublequotes). A negative value of the end
AVG(n,i,j)
row j means the last table row. Only works in the context of a table.
The minimum value of all cells from row i to j in column with name n (in doublequotes). A negative value
MIN(n,i,j)
of the end row j means the last table row. Only works in the context of a table.
The maximum value of all cells from row i to j in column with name n (in doublequotes). A negative value
MAX(n,i,j)
of the end row j means the last table row. Only works in the context of a table.
The standard deviation of all cells from row i to j in column with name n (in doublequotes). A negative value
SD(n,i,j)
of the end row j means the last table row. Only works in the context of a table.
The sum of all cells from row i to j in column with name n (in doublequotes). A negative value of the end
SUM(n,i,j)
row j means the last table row. Only works in the context of a table.
The root mean square of all cells from row i to j in column with name n (in doublequotes). A negative value
rms(n,i,j)
of the end row j means the last table row. Only works in the context of a table.

Table 7.4: muParser: Other functions

will print out only one number - no, not 23, but rather 25. This example was designed to also teach you something about variable
scoping: There are no block-local variables in Python. All statements outside of any function use module scope; that is, variables
attached to one column script or script window. All statements inside a function use that function’s "local" scope, but they can
also read module variables. System-wide globals are stored in the special variable globals. To store your own:
globals.mydata = 5
print globals.mydata

Global scope rules recently changed In older versions, write this instead:
global mydata
mydata = 5
print mydata

7.2.3 Defining Functions and Control Flow

The basic syntax for defining a function (for use within one particular note, for example) is
def answer():
return 42

If you want your function to be accessible from other modules, you have to add it to the globals:
def answer():
return 42
globals.answer = answer

If you have an older versions of QtiPlot, you have to declare it global before the definition:
The QtiPlot Handbook 343 / 452

global answer
def answer():
return 42

You can add your own function to QtiPlot’s function list. We’ll also provide a documentation string that will show up, for
example, in the "set column values" dialog:
def answer():
"Return the answer to the ultimate question about life, the universe and everything."
return 42
qti.mathFunctions["answer"] = answer

If you want to remove a function from the list, do:


del qti.mathFunctions["answer"]

Global scope rules recently changed In older versions, a function’s local scope hid the module scope. That means that if you
entered a function definition in a Note, you would not be able to access (neither reading nor writing) Note-local variables from
within the function. However, you could access global variables as usual.
If-then-else decisions are entered as follows:
if x>23:
print(x)
else:
print("The value is too small.")

You can do loops, too:


for i in range(1, 11):
print(i)

This will print out the numbers between 1 and 10 inclusively (the upper limit does not belong to the range, while the lower limit
does).

7.2.4 Mathematical Functions

Python comes with some basic mathematical functions that are automatically imported (if you use the initialization file shipped
with QtiPlot). Along with them, the constants e (Euler’s number) and pi (the one and only) are defined.

7.2.5 Accessing QtiPlot’s objects from Python

We will assume that you are using the initialization file shipped with QtiPlot. Accessing the objects in your project is straight-
forward,
t = table("Table1")
m = matrix("Matrix1")
g = graph("Graph1")
p = plot3D("Graph2")
n = note("Notes1")
# get a pointer to the QTextEdit object used to display information in the results log ←-
window:
log = resultsLog()
# display some information in the data display toolbar:
displayInfo(text)
# get a pointer to the QLineEdit object in the data display toolbar and access the ←-
information displayed:
info = infoLineEdit()
text = info.text()
The QtiPlot Handbook 344 / 452

Name Description
acos(x) inverse cosine
asin(x) inverse sine
atan(x) inverse tangent
atan2(y,x) equivalent to atan(y/x), but more efficient
ceil(x) ceiling; smallest integer greater or equal to x
cos(x) cosine of x
cosh(x) hyperbolic cosine of x
degrees(x) convert angle from radians to degrees
exp(x) Exponential function: e raised to the power of x.
fabs(x) absolute value of x
floor(x) largest integer smaller or equal to x
fmod(x,y) remainder of integer division x/y
Returns the tuple (mantissa,exponent) such that x=mantissa*(2**exponent) where exponent is an integer and
frexp(x)
0.5 <=abs(m)<1.0
hypot(x,y) equivalent to sqrt(x*x+y*y)
ldexp(x,y) equivalent to x*(2**y)
log(x) natural (base e) logarithm of x
log10(x) decimal (base 10) logarithm of x
modf(x) return fractional and integer part of x as a tuple
pow(x,y) x to the power of y; equivalent to x**y
radians(x) convert angle from degrees to radians
sin(x) sine of x
sinh(x) hyperbolic sine of x
sqrt(x) square root of x
tan(x) tangent of x
tanh(x) hyperbolic tangent of x

Table 7.5: Python: Supported Mathematical Functions


The QtiPlot Handbook 345 / 452

as is creating new objects:


# create an empty table named "tony" with 5 rows and 2 columns:
t = newTable("tony", 5, 2)
# use defaults
t = newTable()
# create an empty matrix named "gina" with 42 rows and 23 columns:
m = newMatrix("gina", 42, 23)
# use defaults
m = newMatrix()
# create an empty graph window
g = newGraph()
# create a graph window named "test" with two layers disposed on a 2 rows x 1 column grid
g = newGraph("test", 2, 2, 1)
# create an empty 3D plot window with default title
p = newPlot3D()
# create an empty note named "momo"
n = newNote("momo")
# use defaults
n = newNote()

The currently selected Table/Matrix etc. can be accessed with the following commands:
t = currentTable()
m = currentMatrix()
g = currentGraph()
n = currentNote()

The functions will only return a valid object if a window of the wanted type is actually selected. You can check if the object is
valid with a simple if clause:
if isinstance(t,qti.Table): print "t is a table"

Every piece of code is executed in the context of an object which you can access via the self variable. For example, entering
self.cell("t",i) as a column formula is equivalent to the convenience function col("t"). Once you have established
contact with a MDI window, you can modify some of its properties, like the name, the window label, the geometry, etc.. For
example, here’s how to rename a window, change its label and the way they are displayed in the window title bar, the so called
caption policy:
t = table("Table1")
setWindowName(t, "toto")
t.setWindowLabel("tutu")
t.setCaptionPolicy(MDIWindow.Both)

The caption policy can have one of the following values:

1. Name -> the window caption is determined by the window name


2. Label -> the caption is determined by the window label
3. Both -> caption = "name - label"

It is also possible to add comments to a project window. The comments may include line breaks, contrary to the window label:
t = table("Table1")
t.setWindowComment("Experiment name: ...\nDate: ...\nProcedure: ...\n")
print t.windowComment()

Here’s how you can access and modify the geometry of a window in the project:
The QtiPlot Handbook 346 / 452

t = table("Table1")
t.setGeometry(10, 10, 800, 600)
print t.x(), t.y(), t.width(), t.height()

It is possible to modify the status (minimized, maximized, normal) of a window in the project:
t = table("Table1")
t.showMinimized()
t.showMaximized()
t.showNormal()

It is also possible to hide a window:


hideWindow(table("Table1"))

...and to restore its visibility:


table("Table1").setVisible(True)

For a fast editing process, you can create template files from existing tables, matrices or plots. The templates can be used later
on in order to create customized windows very easily:
saveAsTemplate(graph("Graph1"), "my_plot.qpt")
g = openTemplate("my_plot.qpt")

Also, you can easily clone a MDI window:


g1 = clone(graph("Graph1"))

If you want to delete a project window, you can use the close() method. You might want to deactivate the confirmation
message, first:
w.confirmClose(False)
w.close()

All QtiPlot subwindows are displayed in a QMdiArea. You can get a pointer to this object via the workspace() method. This
can be particularly usefull if you need to customize the behavior of the workspace via your scripts. Here follows a small example
script that pops-up a message displaying the name of the active MDI subwindow each time a new window is activated:
def showMessage():
QtGui.QMessageBox.about(qti.app, "", workspace().activeSubWindow().objectName())

QtCore.QObject.connect(workspace(), QtCore.SIGNAL("subWindowActivated(QMdiSubWindow *)"), ←-


showMessage)

If you want to automatically arrange all the subwindows in the workspace you can use the following methods:
tileWindows()
cascadeWindows()

It is possible to access the list of all MDI window objects in a QtiPlot project:
for w in qti.app.windows():
print w.objectName()

...or the list of selected MDI windows in the project explorer:


for w in qti.app.selectedExplorerWindows():
print w.objectName()
The QtiPlot Handbook 347 / 452

7.2.6 User settings

It is worth knowing that it is possible to export and store the custom application settings to an *.ini file:
qti.app.saveSettingsAs("/Users/ion/Desktop/myPrefs.ini")

Of course, it is possible to load custom application settings from such an *.ini file or from an *.ini file that has been previousely
created via the preferences dialog, using the Save As... button:
qti.app.readSettings("/Users/ion/Desktop/myPrefs.ini")

7.2.7 Project files

It is possible to load a project file or any file type supported by QtiPlot using the function open(fileName, factorySettings
= False, newProject = True). If the factorySettings argument is set to True, your current custom settings are
discarded and QtiPlot resets all options to the default values. If the newProject argument is set to True (the default), a new
project window is created. This function returns a reference to the main application window, which can be null if the input file
doesn’t exist or is not readable, for example.
app = qti.app.open("/Users/ion/Desktop/hygecdf.qti")
if not app:
print "Invalid reference!"
else:
dir = app.rootFolder()
for w in dir.windows():
print w.objectName()

The current project file can be closed using the function closeProject(). If you do not want to save your modifications to
the project and want to avoid the QtiPlot save message dialog, you can use the function setSavedProject(), like shown
bellow:
qti.app.setSavedProject()
qti.app.closeProject()

7.2.8 Project folders

Storing your data tables/matrices and your plots in folders can be very convenient and helpful when you’re analyzing loads of
data files in the same project. New objects will always be added to the active folder. You can get a pointer to it via:
f = activeFolder()

The functions table, matrix, graph and note will start searching in the active folder and, failing this, will continue with a depth-first
recursive search of the project’s root folder, given by:
f = rootFolder()

In order to access subfolders and windows, the following functions are provided:
f1 = folder("folder1")
f2 = f.folder("folder2", caseSensitive=True, partialMatch=False)
f3 = f.folders()[2] # f3 is the 3rd subfolder of parent folder f
t = f.table(name, recursive=False)
m = f.matrix(name, recursive=False)
g = f.graph(name, recursive=False)
n = f.note(name, recursive=False)
lst = f.windows()
for w in lst:
print w.objectName()
The QtiPlot Handbook 348 / 452

If you supply True for the recursive argument, a depth-first recursive search of all subfolders will be performed and the first
match returned.
New folders can be created using:
newFolder = addFolder("New Folder", parentFolder = 0)

If the parentFolder is not specified, the new folder will be added as a subfolder of the project’s root folder. When you
create a new folder via a Python script, it doesn’t automatically become the active folder of the project. You have to set this
programatically, using:
changeFolder(newFolder, bool force=False)

Folders can be deleted using:


deleteFolder(folder)

Folders can be renamed using the function renameFolder(). Please note that this operation may fail if the new folder name
already exists. An error message pops-up in this case. Empty input strings are ignored.
f = folder("f1")
if renameFolder(f, "f2"):
print "Success!"

It is possible to copy folders within a project:


copyFolder(folder("source"), folder("destination"))

Project windows can be moved between existing folders using:


table("Table1").moveTo(folder("folder1"))
graph("Graph1").moveTo(addFolder("folder2"))

You can save a window or a folder as a project file, and of course, you can also save the whole project:
saveWindow(table("Table1"), "Table1.qti", compress=False)
saveFolder(folder, "new_file.qti", compress=False)
saveProjectAs("new_file_2.qti", compress=False)
saveProject()
print projectName()

If compress is set to True, the project file will be archived to the .gz format, using zlib.
Also, you can load a QtiPlot or an Origin project file into a new folder. The new folder will have the base name of the project file
and will be added as a subfolder to the parentFolder or to the current folder if no parent folder is specified.
newFolder = appendProject("projectName", parentFolder = 0)

If you don’t want to be asked for confirmation when a table/matrix is renamed during this operation, or when deleting a folder
via a Python script, you must change your preferences concerning prompting of warning messages, using the Preferences dialog
("Confirmations" tab).
Folders store their own log information containing the results of the analysis operations performed on the child windows. This
information is updated in the result log window each time you change the active folder in the project. You can access and
manipulate these log strings via the following functions:
text = folder.logInfo()
folder.appendLogInfo("Hello!")
folder.clearLogInfo()

Folders can also store a comment string:


The QtiPlot Handbook 349 / 452

f = folder("test")
f.setComment("My comments!")
print f.comment()

Finally, it is worth mentioning that it is possible to access the list of all selected folder items in the project explorer:
for folder in qti.app.selectedFolders():
print folder.name()

7.2.9 Working with Tables

We’ll assume that you have assigned some table to the variable t. You can access its numeric cell values with
t.cell(col, row)
# and
t.setCell(col, row, value)

Whenever you have to specify a column, you can use either the column name (as a string) or the consecutive column number
(starting with 1). Row numbers also start with 1, just as they are displayed. In many places there is an alternative API which
represents a table as a Python sequence is provided. Here rows are addressed by Python indices or slices which start at 0. These
places are marked as such.
If you want to work with arbitrary texts or the textual representations of numeric values, you can use:
t.text(col, row)
# and
t.setText(col, row, string)

An alternative way to get/set the value of a cell is using the getter/setter functions bellow. Assigning a None value will clear the
cell:
t.cellData(col, row)
# and
t.setCellData(col, row, value)

Based on the type of the column, QtiPlot handles all the casting under the hood and throws an TypeError if setting the data
for a cell isn’t possible. The type of a column can be one of the following:

Table.Numeric: returns/accepts only numerical values.


Table.Text: returns/accepts only text strings.
Table.Date: returns/accepts Python datetime.datetime objects and also accepts a QDateTime.
import time
from datetime import datetime
t = newTable("datetime", 2, 1)
t.setColDateFormat(1, "dd/MM/yyyy")
t.setCellData(1, 1, datetime.utcnow()) # from Python datetime object
t.setCellData(1, 2, QDateTime.currentDateTime()) # from QDateTime object

Table.Time: returns/accepts datetime.time objects and also accepts a QTime.


import time
from datetime import datetime
t = newTable("time", 2, 1)
t.setColTimeFormat(1, "hh:mm:ss")
t.setCellData(1, 1, datetime.now().time()) # from Python time object
t.setCellData(1, 2, QTime.currentTime()) # from QTime object
The QtiPlot Handbook 350 / 452

Table.Month: accepts any numerical values, including floating point values and internally transforms them to integer values
corresponding to the months of the year: 1 (January) to 12 (December, for which also 0 is accepted).
Table.Day: accepts any numerical values, including floating point values and internally transforms them to integer values cor-
responding to the days of the week: 1 (monday) to 7 (sunday, for which also 0 is accepted).
Table.TextAndNumeric: returns/accepts both numerical values and text strings. It is the default type.

You can set the format of a column to text using:


t.setColTextFormat(col)

Or you can adjust the numeric format:


t.setColNumericFormat(col, format, precision)

were col is the number of the column to adjust and precision states the number of digits. The format can be one of the
following:

Table.Default (0) standard format


Table.Decimal (1) decimal format with precision digits
Table.Scientific (2) lower case scientific format (e.g. 1.0e+03)
Table.ScientificUpperCase (3) upper case scientific format (e.g. 1.0E+03)

You can reset the Table.TextAndNumeric type for a column if it was modified previously using the following function:
t.setColTextNumericFormat(col, format, precision)

In the same way you can set a column to hold a date. Here the text of a cell is interpreted using a format string:
t.setColDateFormat(col, format)
t.setColDateFormat("col1", "yyyy-MM-dd HH:mm")

were col is the name/number of a column and format the format string. In the format string the following placeholders are
recognized, all other input characters being treated as text:

d the day as number without a leading zero (1 to 31)


dd the day as number with a leading zero (01 to 31)
ddd the abbreviated localized day name (e.g. ’Mon’ to ’Sun’)
dddd the long localized day name (e.g. ’Monday’ to ’Sunday’)
M the month as number without a leading zero (1-12)
MM the month as number with a leading zero (01-12)
MMM the abbreviated localized month name (e.g. ’Jan’ to ’Dec’)
MMMM the long localized month name (e.g. ’January’ to ’December’)
yy the year as two digit number (00-99)
yyyy the year as four digit number
h the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
hh the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
The QtiPlot Handbook 351 / 452

H the hour without a leading zero (0 to 23, even with AM/PM display)
HH the hour with a leading zero (00 to 23, even with AM/PM display)
m the minute without a leading zero (0 to 59)

mm the minute with a leading zero (00 to 59)


s the second without a leading zero (0 to 59)
ss the second with a leading zero (00 to 59)

z the milliseconds without leading zeroes (0 to 999)


zzz the milliseconds with leading zeroes (000 to 999)
AP or A interpret as an AM/PM time. AP must be either "AM" or "PM".
ap or a interpret as an AM/PM time. ap must be either "am" or "pm".

Analog you can say that a text column should hold a time only...
t.setColTimeFormat(col, format)
t.setColTimeFormat(1, "HH:mm:ss")

... a month ...


t.setColMonthFormat(col, format)
t.setColMonthFormat(1, "M")

Here the format is the following:

M Only the first letter of the month, i.e. "J"

MMM The short form, like "Jan"


MMMM The full name, "January"

... or the day of week:


t.setColDayFormat(col, format)
t.setColDayFormat(1, "ddd")

Here the format is the following:

d Only the first letter of the day, i.e. "M"


ddd The short form, like "Mon"

dddd The full name, "Monday"

If you need all the data of a row or column you can use the rowData() and colData() methods. This is much faster then
iterating manually over the cells. Alternatively you can use the [] operator in combination with Python indices or slices, which
start at 0.
valueList = t.colData(col) # col may be a string or a number starting at 1
rowTuple = t.rowData(row) # row number starting at 1
rowTuple = t[idx] # row index starts at 0
rowTupleList = t[slice]

A Table is iterable. The data is returned row wise as tuple.


The QtiPlot Handbook 352 / 452

for c1, c2, c3 in t:


# do stuff, assuming t has three columns

It is possible to assign row, random or normal random values to a complete column or to a subset of rows in a column:
t.setRowValues(1, 1, 15)#startRow = 1, endRow = 15
t.setRandomValues(col, startRow = 1, endRow = -1)
t.setNormalRandomValues(col, startRow = 1, endRow = -1, standardDeviation = 1.0)

Assigning values to a complete row or column is also possible. While the new row data has to be a tuple which length must
match the column number, column data just has to be iteratable. If the iterator stops before the end of the table is reached, a
StopIteration exception is raised. In combination with the offset this allows to fill a column chunk wise. A positive
offset starts filling the column after this row number. A negative offset ignores the first values of the iterator.
t.setColData(col, iterableValueSequence, offset=0)
# just fill the first column with a list of values, staring at row 6
t.setColData(1, [12,23,34,56,67], 5)
# fill the second column with Fibonacci numbers, omitting the first three.
def FibonacciGenerator():
a, b = 1, 1
while True:
a, b = b, a+b
yield a
t.setColData(2, FibonacciGenerator(), -3)
t.setRowData(row, rowTuple) # row starts at 1
# assuming t has exactly two columns...
t.setRowData(2, (23, 5)) # fill the second row
t[1] = 23, 5 # using a Python index, starting at 0
# adding a new row and set it’s values
t.appendRowData(rowTuple)

The number of columns and rows of a table can be accessed or modified using:
t.numRows() # same as len(t)
t.numCols()
t.setNumRows(number)
t.setNumCols(number)

You can add a new column at the end of the table using the addColumn() function. This function returns a reference to the
new column object.
c1 = t.addColumn()
c1.setName("A")

c2 = addColumn(Table.X)
c2.setName("X")

It is possible to insert new columns before a startColumn using the functions below:
t.insertColumns(startColumn, count)

Adding an empty row at the end of the table is done with the addRow() method. It returns the new row number.
newRowIndex = t.addRow()

It is also possible to swap two columns using:


t.swapColumns(column1, column2)

You can delete a column or a range of rows using the functions below:
The QtiPlot Handbook 353 / 452

t.removeCol(number)
t.deleteRows(startRowNumber, endRowNumber)

It is also possible to use Python’s del statement to remove rows. Note that in this case a Python index or slice (instead of row
numbers) is used, which start at 0.
del t[5] # deletes row 6
del t[0:4] # deletes row 1 to 5

Column names can be read and written with:


t.colName(number)
t.colNames()
t.setColName(col, newName, enumerateRight=False)
t.setColNames(newNamesList)

When setting a column name, please note that, for internal consistency reasons, the underscore character is not allowed and is
automatically replaced with a minus sign.
If enumerateRight is set to True, all the table columns starting from index col will have their names modified to a
combination of the newName and a numerical increasing index. If this parameter is not specified, by default it is set to False.
The plural forms get/set all headers at once.
Other column properties like the long name, the unit and the comment can be read/modified using the following methods:
t.setColLongName(1, "Distance")
print t.colLongName(1)
t.setColUnit(1, "nm")
print t.colUnit(1)
t.setColComment(1, "Experiment no. 10")
print t.colComment(1)

You can enable/disable the display of these header label rows via the following functions:
t.showLongName(True)
t.showUnits(False)
t.showComments(True)

You can change the plot role (abscissae, ordinates, error bars, etc...) of a table column col using:
t.setColumnRole(col, role)
print t.columnRole(col)

where role specifies the desired column role:

0. Table.None
1. Table.X
2. Table.Y

3. Table.Z
4. Table.xErr
5. Table.yErr

6. Table.Label

You can normalize a single column or all columns in a table:


The QtiPlot Handbook 354 / 452

t.normalize(col)
t.normalize()

Sort a single or all columns:


t.sortColumn(col, order = Qt.AscendingOrder)
t.sort(type = Table.IndependentSort, order = Qt.AscendingOrder, leadingColumnName = "")

where the variable type can take one of the following values:

0. Table.IndependentSort

1. Table.DependentSort

and the order argument can be:

0. Qt.AscendingOrder
1. Qt.DescendingOrder

The small script bellow demonstrates how to use the sort method in order to perform a dependent sort in descending order on an
entire table using a leading column:
t = newTable()
t.setColName(1, "LeadCol")
t.setRowValues(1)
t.setRowValues(2)
t.sort(Table.DependentSort, Qt.DescendingOrder, "LeadCol")

It is possible to customize the alignment of the text from the table cells which by default is set to Qt.AlignCenter:
t.setAlignment(Qt.AlignLeft) # for all table columns
t.setAlignment(Qt.AlignRight, True) # for selected columns only

7.2.9.1 Columns

It is also possible to manipulate individual table columns using their index. Column indices start at 1:
t = newTable("test", 10, 2)
c1 = t.column(1)
c1.setName("A")
c2 = t.column(2)
c2.setName("Date")

Column objects can also be accessed by their name. For example using the test table created with the script above, one gets a
referrence to the column objects as follows:
c1 = t.column("A")
c2 = t.column("Date")

Please beware that the column method used above returns a null reference if the table doesn’t contain a column with the name
you indicated. Once you have a valid reference to a column object, c, you can access all its properties using the following getter
functions:
The QtiPlot Handbook 355 / 452

c.name() # column short name


c.longName() # column long name
c.fullName() # returns tableName_shortName
c.unit()
c.comment()
c.command() # the formula set for the column
c.formatInfo() # the format string in case the column type is date/time
c.numericPrecision() # the number of significant digits
c.numericFormat()
c.alignment() # alignment of the text: Qt.AlignLeft, Qt.AlignCenter or Qt.AlignRight
c.type()
c.plotRole()
c.isReadOnly()
c.width()
c.size() # returns the number of rows
c.isEmpty() # returns True if all cells in the column are empty
c.lastValidRow() # index of the last non empty cell starting from the bottom
c.hasOnlyTextValues() # returns True if all cells have string values
c.index() # column index in the parent table (leftmost column has index 1)

It is of course possible to modify the above properties using the corresponding setter functions:
c.setName("A")
c.setLongName("test long name")
c.setUnit("cm")
c.setComment("column comment")
c.updateHeaderView() # makes the changes visible in the table header
c.setCommand("sin(0.1*i)")
c.setDateFormat("dd/MM/yyyy") # set format to Table.Date and format string to "dd/MM/yyyy"
c.setTimeFormat("hh:mm:ss")# set format to Table.Time and format string to "hh:mm:ss"
c.setMonthFormat("MMMM") # set Table.Month format; other format strings: "M" and "MMM"
c.setDayFormat("dddd") # set Table.Day format; other format strings: "d" and "ddd"
c.setNumericPrecision(10)
c.setNumericFormat(Table.Decimal, 7) # set decimal format with 7 precision digits
c.setType(Table.Text) # set text format
c.setPlotRole(Table.X)
c.setReadOnly()
c.setReadOnly(False) # reenable column modifications
c.setWidth(90)
c.setAlignment(Qt.AlignRight)
c.setHidden() # hides column
c.setHidden(False) # makes column visible

When setting a column name, please note that, for internal consistency reasons, the underscore character is not allowed and is
automatically replaced with a minus sign.
Please note that after setting a new column formula you need to trigger a recalculation of the cell values:
t = newTable("test", 30, 2)
c = t.column(2)
c.setCommand("sin(0.1*i)")
t.recalculate(c.index())

It is straightforward to access cell values using their index, but you must be aware of the fact that for all column functions the
row indices start at zero, contrary to table functions where indices start at 1:
val = c.value(0) # returns the value of the 1st cell as a double
string = c.text(0) # returns the text string displayed in the 1st cell

It is also possible to get a Python list with the values from a range of cells or from the entire column:
The QtiPlot Handbook 356 / 452

print c.values(1) # all cells starting with 2nd row


print c.values(1, 2) # values in 2nd and 3rd row
print c.values() # all column values

The value of a column cell can be modified using the following setter functions:
c.setValue(0, 1178.14)
c.setText(0, "text string")

It is also possible to fill a range of cells or the whole column with values from a Python list:
t = newTable("test", 10, 3)
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
t.column(1).setValues(list1, 0, 9) # fill cells from 1st to 10th
list2 = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]
t.column(2).setValues(list2)
list3 = [’a’, ’b’, ’c’, ’d’, "test"]
t.column(3).setValues(list3, 1) # fill cells starting with 2nd row

QtiPlot stores column cell values either as floating point numerical values (doubles) or as text strings, depending on the column
type. If the column type is Table.Date or Table.Time QtiPlot converts internaly the numerical values to a QDateTime object
using the Table.dateTime() function and displays them using the format string specified for the column. QtiPlot also
provides two methods that allow to perform the reverse conversion from a QDateTime or QTime object to a double floating point
numerical value:
val1 = Table.fromDateTime(QDateTime.currentDateTime())
val2 = Table.fromTime(QTime.currentTime())
print val1
print val2

The following script shows how you can fill a table column with date values:
t = newTable("test", 10, 2)
c = t.column(1)
c.setName("Date")
c.setDateFormat("dd/MM/yyyy")

date = QDateTime.currentDateTime()
for i in range(0, c.size()):
c.setValue(i, Table.fromDateTime(date.addDays(i)))

You can delete the content of a single cell or a range of cells using the functions bellow. Please note that after these operations
you need to refresh the table view in order to be able to observe the changes:
c.clearCell(1) # clear 2nd cell
c.clear(0, 9) # clear range from 1st to 10th cell
c.deleteCells(0, 9) # delete/remove range from 1st to 10th cell
c.updateView()

For all column operations that involve a cell range if you don’t specify the index of th start row it is by default considered to be
zero and if you omit the end row index (or you set it to -1) it is considered to be index of the last/bottom cell:
c.clear(10) # keeps the first 10 cells from top and clears the rest
# it is equivalent to:
c.clear(10, -1)
c.clear() # clears the whole column
c.updateView()

The following functions provide automatic filling of a column with data values:
The QtiPlot Handbook 357 / 452

c.setRowValues(0, 7) # fill cell range with row indices


c.setRandomValues(0, 9) # fill cell range with random values
c.setNormalRandomValues(0, -1, 1.0) # fill column with a Gaussian distribution with ←-
standard deviation sigma = 1.0

It is possible to normalize a column to 1 or to sort its values in ascending or descending order:


c.normalize()
c.sort() # sort column in ascending order
c.sort(Qt.DescendingOrder) # sort column in descending order

The script bellow shows how to duplicate a table column:


t = table("Table1")
c = t.duplicateColumn(t.column(1))
c.setName("Col1Clone")

Finally, it is worth mentioning that you can copy a column (with or without its cell values) from one table to another:
t1 = newTable("test", 10, 3)
t2 = table("Table1")
c1 = t1.column(1)
c1.copy(t2.column(1))
c2 = t1.column(2)
c2.copy(t2.column(2), False) # don’t copy data values
c3 = t1.column(3)
c3.copyData(t2.column(3)) # copy only the data values

7.2.9.2 Statistics on columns

There are a number of predefined statistical functions that can be used for columns having a numerical (not Text) type:
c.rms(0, 9) # returns the root mean square, also known as the quadratic mean
c.sd(0, 10) # returns the standard deviation of a cell range
c.sum(0, 10) # returns the sum of all cells in the range
c.avg(0, 20) # returns the average of a cell range
c.avg() # returns the average of the whole column
c.minValue(0, 9) # returns the minimum value in a cell range
c.minValue() # returns the minimum value in column
c.maxValue(0, 100) # returns the maximum value in a cell range

7.2.9.3 Data searching

It is possible to search for a text string in a column. The search operation returns the row index of the first occurence of the
researched string. If the text string can not be found the function returns -1. Please note that by default the search operation is
case insensitive and wildcard characters are allowed.
row = c.find("qti")
print row
row = c.find("Qti", QTextDocument.FindCaseSensitively) # case sensitive search
print row
row = c.find("Tuesday", QTextDocument.FindWholeWords) # find whole words
print row
The QtiPlot Handbook 358 / 452

7.2.9.4 Data mask

It is possible to mask a data cell or a range of cells in a column using:


c.mask(1, 10)
c.updateView()
print c.isMasked(1) # returns True
print c.hasMaskedCells(11, -1) # returns False

c.swapMask() # set a complementary mask


c.updateView()

7.2.9.5 Import ASCII files

The function importASCII can be used to import values from an ASCII file filePath, using sep as separator character,
ignoring ignoreLines lines at the beginning of the file and all lines starting with a comment string. Please note that the
default values for the arguments of this function are given after the equality sign.
t.importASCII(filePath, sep="\t", ignoreLines=0, renameCols=False, stripSpaces=True, ←-
simplifySpace=False, importComments=False, comment="#", readOnly=False, importAs=Table. ←-
Overwrite, locale=QLocale(), endLine=0, maxRows=-1)

The names of the function arguments should be self explaining. For example, if the renameCols argument is given the value
True, QtiPlot will try to rename the table columns using the text strings from the first line in the imported file. Same for the
importComments argument, but in this case the second imported line is used to set the comments for the table columns.
If the simplifySpace argument is given the value True all whitespace is removed from the start and the end of each line of the
file and each sequence of internal whitespace is replaced with a single space. This can of course affect the number of imported
columns if the column separator sep contains whitespace characters.
As you see from the above list of import options, you have the possibility to set the new columns as read-only. This will prevent
the imported data from being modified. You have the possibility to remove this protection at any time, by using:
t.setReadOnlyColumn(col, False)

The importAs argument can have the following values:

0. Table.NewColumns: data values are added as new columns.


1. Table.NewRows: data values are added as new rows.

2. Table.Overwrite: all existing values are overwritten (default value).

If the number format in the imported ASCII file does not match the currently used decimal separators convention, you can specify
the correct format via the locale argument, like in the example bellow:
t.importASCII("test.txt", ’;’, 5, True, False, False, True, "", False, Table.Overwrite, ←-
QLocale(QLocale.German))

The endLine argument specifies the end line character convention used in the ascii file. Possible values are: 0 for line feed (LF),
which is the default value, 1 for carriage return + line feed (CRLF) and 2 for carriage return only (usually on Mac computers).
The last parameter maxRows allows you to specify a maximum number of imported lines. Negative values mean that all data
lines should be imported.
The QtiPlot Handbook 359 / 452

7.2.9.6 Importing Excel sheets

It is possible to import a sheet from an Excel .xls file file to a table, using:
t = importExcel(file, sheet)

Please note that the integer variable sheet starts at 0 and must be lower than the number of sheets in the Excel workbook. If
the sheet index is not specified, all non-empty sheets in the Excel workbook are imported into separate tables and a reference to
the table containing the data from the last sheet is returned.

7.2.9.7 Importing ODF spreadsheets

It is possible to import a sheet from an ODF spreadsheet .ods file to a table, using:
t = importOdfSpreadsheet(file, sheet)

Please note that the integer variable sheet starts at 0 and must be lower than the number of sheets in the file. If the sheet index
is not specified, all non-empty sheets in the spreadsheet are imported into separate tables and a reference to the table containing
the data from the last sheet is returned.

7.2.9.8 Export Tables

You can export values from a table to an ASCII file, using sep as separator character. The ColumnLabels option allows
you to export or ignore the column labels, ColumnComments does the same for the comments displayed in the table header
and the SelectionOnly option makes possible to export only the selected cells of the table.
t.exportASCII(file,sep="\t",ColumnLabels=False,ColumnComments=False,SelectionOnly=False)

Other settings that you can modify are the text displayed as a comment in the header of a column...
t.setComment(col, newComment)

... or the expression used to calculate the column values. Please beware that changing the command doesn’t automatically update
the values of the column; you have to call recalculate explicitly. Calling it with just the column as argument will recalculate
every row. Forcing muParser can speed things up.
t.setCommand(col, newExpression)
t.recalculate(col, startRow=1, endRow=-1, forceMuParser=False, notifyChanges=True)

You can also modify the width of a column (in pixels) or hide/show table columns:
t.setColumnWidth(col, width)
t.hideColumn(col, True)

If one or several table columns are hidden you can make them visible again using:
t.showAllColumns()

You can ensure the visibility of a cell with:


t.scrollToCell(col, row)

After having changed some table values from a script, you will likely want to update dependent Graphs:
t.notifyChanges()

As a simple example, let’s set some column values without using the dialog.
The QtiPlot Handbook 360 / 452

t = table("table1")
for i in range(1, t.numRows()+1):
t.setCell(1, i, i**2)
t.notifyChanges()

While the above is easy to understand, there is a faster and more pythonic way of doing the same:
t = table("table1")
t.setColData(1, [i*i for i in range(len(t))])
t.notifyChanges()

You can check if a column or row of a table is selected by using the following functions:
t.isColSelected(col)
t.isRowSelected(row)

7.2.9.9 NumPy interface

Using this built-in interface it is possible to retrieve the values from a table column as a NumPy array:
print(table("Table1").column("A").numPyArray())

The script bellow demonstrates how to set the values of a table column using a NumPy array as input. Please note that only
floating point values are allowed:
import numpy as np
table("Table1").column("A").setNumPyArrayValues(np.array([1., 2., 3.]))

7.2.9.10 R interface

If RPy2 is available, the default initialization file sets up the helper functions qti.Table.toRDataFrame and qti.app.newTabl
to convert back and forth between R data frames and QtiPlot tables. Here is a little example of an R session...
df <- read.table("/some/path/data.csv", header=TRUE)
m <- mean(df)
v <- var(df)
source("/some/path/my_func.r")
new_df <- my_func(df, foo=bar)

... and now the same from within QtiPlot:


df = table("Table1").toRDataFrame()
print R.mean(df), R.var(df)
R.source("/some/path/my_func.r")
new_df = R.my_func(df, foo=bar)
newTableFromRDataFrame(new_df, "my result table")

7.2.10 Linear Color Maps

Linear color maps are widely used in QtiPlot: for matrices, 2D and 3D plots. The script bellow defines a custom color map that
is later on used to set the palette of a matrix:
map = LinearColorMap(Qt.red, Qt.blue)
map.setMode(LinearColorMap.FixedColors) # default mode is LinearColorMap.ScaledColors
map.addColorStop(0.2, Qt.magenta)
map.addColorStop(0.7, Qt.cyan)
matrix("Matrix1").setColorMap(map)
The QtiPlot Handbook 361 / 452

Custom color maps can be saved to XML files which can be used afterwards to quicky initialize new color maps:
map = LinearColorMap(Qt.yellow, Qt.blue)
map.addColorStop(0.3, Qt.magenta)
map.addColorStop(0.5, Qt.red)
map.addColorStop(0.7, Qt.cyan)
map.setIntensityRange(1, 100)
map.save("/Users/ion/Desktop/rainbow.xml")

mapClone = LinearColorMap.loadFromFile("/Users/ion/Desktop/rainbow.xml")

QtiPlot also provides a default rainbow color map:


map = LinearColorMap.rainbowMap()

7.2.11 Working with Matrices

Matrix objects have a dual view mode: either as images or as data tables. Assuming that you have assigned some matrix to the
variable m, you can change its display mode via the following function:
m.setViewType(Matrix.TableView)
m.setViewType(Matrix.ImageView)

If a matrix is viewed as an image, you have the choice to display it either as gray scale or using a predefined color map:
m.setGrayScale()
m.setRainbowColorMap()
m.setDefaultColorMap() # default color map defined via the 3D plots tab of the preferences ←-
dialog

You can also define custom color maps:


map = LinearColorMap(QtCore.Qt.yellow, QtCore.Qt.blue)
map.setMode(LinearColorMap.FixedColors) # default mode is LinearColorMap.ScaledColors
map.addColorStop(0.2, QtCore.Qt.magenta)
map.addColorStop(0.7, QtCore.Qt.cyan)
m.setColorMap(map)

You have direct access to the color map used for a matrix via the following functions:
map = m.colorMap()
col1 = map.color1()
print col1.green()
col2 = map.color2()
print col2.blue()

Accessing cell values is very similar to Table, but since Matrix doesn’t use column logic, row arguments are specified before
columns and obviously you can’t use column name.
m.cell(row, col)
m.setCell(row, col, value)
m.text(row, col)
m.setText(row, col, string)

An alternative solution to assign values to a Matrix, would be to define a formula and to calculate the values using this formula,
like in the following example:
m.setFormula("x*y*sin(x*y)")
m.calculate()
The QtiPlot Handbook 362 / 452

You can also specify a column/row range in the calculate() function, like this:
m.calculate(startRow, endRow, startColumn, endColumn)

Before setting the values in a matrix you might want to define the numeric precision, that is the number of significant digits used
for the computations:
m.setNumericPrecision(prec)

You can change the dimensions of a matrix:


m.setDimensions(rows, columns)
m.setNumRows(rows)
m.setNumCols(columns)

Also, like with tables, you can access the number of rows/columns in a matrix:
rows = m.numRows()
columns = m.numCols()

It is also possible to change the dimensions of a matrix by resampling it, using bilinear or bicubic interpolation:
m.resample(rows, cols) # bilinear interpolation by default
m.resample(rows, cols, 1) # bicubic interpolation

You can also smooth the matrix data. Internally this method resamples the matrix to half size or doubles its dimensions and after
that it resamples it back to the initial size using bilinear interpolation:
m.smooth()

Matrix objects allow you to define a system of x/y coordinates that will be used when plotting color/contour maps or 3D height
maps. You can manipulate these coordinates using the following functions:
xs = m.xStart()
xe = m.xEnd()
ys = m.yStart()
ye = m.yEnd()
m.setCoordinates(xs + 2.5, xe, ys - 1, ye + 1)

It is also possible to define non-linear X/Y coordinates for matrices using data stored in table columns:
m = matrix("Matrix1")
m.setXCoordinates(table("Table1").column(2))
m.setYCoordinates(table("Table2").column(1))
print m.xColumnName()
for x in m.xCoordinates():
print(x)

print m.yColumnName()
for y in m.yCoordinates():
print(y)

The column used for the X coordinates must contain a number of valid, non empty cells at least equal with the number of columns
in the matrix. Similarly, the column used for the Y coordinates must contain a number of valid, non empty cells at least equal with
the number of rows in the matrix. QtiPlot sorts these data values in ascending order before assigning them as matrix coordinates.
These non-linear coordinates can be reset using the following methods:
m.resetXCoordinates()
m.resetYCoordinates()

or by specifying a new linear range:


The QtiPlot Handbook 363 / 452

m.setXCoordinates(1.5, 10.5)
m.setYCoordinates(10.3, 20.3)

It is possible to get pointers to the column objects that store the non-linear coordinates using:
xCol = m.xColumn()
yCol = m.yColumn()
print xCol.fullName(), yCol.fullName()

As shown above, it is possible to get a list with all the X or Y coordinates using:
for x in m.xCoordinates():
print(x)
for y in m.yCoordinates():
print(y)

Alternatively you can get the values of the individual X/Y coordinates as shown in the script bellow:
for i in range (0, m.numCols()):
print m.x(i)
for i in range (0, m.numRows()):
print m.y(i)

You can also define labels, units and comments for the X, Y or Z axis that can be used in plots:
m.setXLabel("Width")
print m.xLabel()
m.setXUnit("cm")
print m.xUnit()
m.setXComment("X axis comment")
print m.xComment()

m.setYLabel("Height")
print m.yLabel()
m.setYUnit("mm")
print m.yUnit()
m.setYComment("Y axis comment")
print m.yComment()

m.setZLabel("Intensity")
print m.zLabel()
m.setZUnit("a.u.")
print m.zUnit()
m.setZComment("Z axis comment")
print m.zComment()

The horizontal and vertical headers of a matrix can display either the x/y coordinates or the column/row indexes:
m.setHeaderViewType(Matrix.ColumnRow)
m.setHeaderViewType(Matrix.XY)

There are several built-in transformations that you can apply to a matrix object. You can transpose or invert a matrix and calculate
its determinant, provided, of course, that the conditions on the matrix dimensions, required by these operations, are matched:
m.transpose()
m.invert()
d = m.determinant()

Some other operations, very useful when working with images, like 90 degrees rotations and mirroring, can also be performed.
By default rotations are performed clockwise. For a counterclockwise rotation you must set the clockwise parameter to
False.
The QtiPlot Handbook 364 / 452

m.flipVertically()
m.flipHorizontally()
m.rotate90(clockwise = True)

It is possible to perform a Fast Fourier Transform on a matrix:


m.fft() # forward FFT
m.fft(True) # inverse FFT

It is also possible to apply a FFT filter to a matrix:


m.fftFilter(FFTFilter.LowPass, 0.5)
m.fftFilter(FFTFilter.HighPass, 0.5)
m.fftFilter(FFTFilter.BandPass, 0.5, 1.5)
m.fftFilter(FFTFilter.BandBlock, 0.75, 0.9)

Please note that sometimes, after a change in the matrix settings, you need to use the following function in order to update the
display:
m.resetView()

Also, it’s worth knowing that you can easily import image files to matrices, that can be used afterwards for plotting (see the next
section for more details about 2D plots):
m1 = importImage("C:/poze/adi/PIC00074.jpg")
m2 = newMatrix()
m2.importImage("C:/poze/adi/PIC00075.jpg")

The algorithm used to import the image returns a gray value between 0 and 255 from the (r, g, b) triplet corresponding to each
pixel. The gray value is calculated using the formula: (r * 11 + g * 16 + b * 5)/32
For custom image analysis operations, you can get a copy of the matrix image view, as a QImage object, via:
image = m.image()

You can export matrices to all raster image formats supported by Qt or to any of the following vectorial image format: EPS, PS,
PDF or SVG using:
m.export(fileName)

This is a shortcut function which uses some default parameters in order to generate the output image. If you need more control
over the export parameters you must use one of the following functions:
m1.exportRasterImage(fileName, quality = 100, dpi = 0, compression = 0)
m2.exportVector(fileName, color = True)

where the quality parameter influences the size of the output file. The higher this value (maximum is 100), the higher the
quality of the image, but the larger the size of the resulting files. The dpi parameter represents the export resolution in pixels
per inch (the default is screen resolution). The compression parameter can be 0 (no compression) or 1 (LZW) and is only
effectif for .tif/.tiff images. It is neglected for all other raster image formats.
You can also import an ASCII data file, using sep as separator characters, ignoring ignore lines at the head of the file and
all lines starting with a comment string:
m.importASCII(file, sep="\t", ignore=0, stripSpaces=True, simplifySpace=False, comment="#",
importAs=Matrix.Overwrite, locale=QLocale(), endLine=0, maxRows=-1)

The importAs flag can have the following values:

0. Matrix.NewColumns: data values are added as new columns.


The QtiPlot Handbook 365 / 452

1. Matrix.NewRows: data values are added as new rows.


2. Matrix.Overwrite: all existing values are overwritten (default value).

The locale parameter can be used to specify the convention for decimal separators used in your ASCII file.
The endLine flag specifies the end line character convention used in the ascii file. Possible values are: 0 for line feed (LF),
which is the default value, 1 for carriage return + line feed (CRLF) and 2 for carriage return only (usually on Mac computers).
The last parameter maxRows allows you to specify a maximum number of imported lines. Negative values mean that all data
lines must be imported.
Also, you can export values from a matrix to an ASCII file, using sep as separator characters. The SelectionOnly option
makes possible to export only the selected cells of the matrix.
m.exportASCII(file, sep="\t", SelectionOnly=False)

7.2.11.1 NumPy interface

Using this built-in interface it is possible to retrieve the values from a matrix as a bidimensional NumPy array:
print(matrix("Matrix1").numPyArray())

The script bellow demonstrates how to set the values of a matrix using a bidimensional NumPy array as input. Please note that
only floating point values are allowed:
import numpy as np
a = np.array([[1., 2., 3.], [4., 5., 6.]])
matrix("Matrix1").setNumPyArrayValues(a)

7.2.12 Table/Matrix conversion

If you need to get data from a table, in order to use it in a matrix (or vice-versa), you can avoid time consuming copy/paste
operations and speed up the whole process by simply converting the table into a matrix:
m = tableToMatrix(table("Table1"))
t = matrixToTable(m)

For the production of contour or surface plots, you can convert a regular XYZ data table ("regular" meaning that cells in the X
and Y columns of the table define a regular 2D grid) into a matrix. A tolerance of 15% is used for the X and Y positions when
parsing the 2D grid.
m1 = table("Table1").convertToMatrixRegularXYZ("Data")

In the example above "Data" is the name of the Z column. You can also specify the Z column by its number and choose a limited
cell range for the conversion like in the example bellow where 0 is the index of the start row and 15 the index of the end row. If
no cell range is specified the whole column is used for the conversion.
m2 = table("Table1").convertToMatrixRegularXYZ(2, 0, 15)

You can also convert a random XYZ data table into a matrix ("random" meaning that cells in the X and Y columns of the table
do not define a regular 2D grid). In the example bellow "Data" is the name of the Z column, 0 is the number of the start row
and 100 is the index of the end row. The resulting matrix will be 400 rows by 500 columns. The last parameter (the radius) is
used by the modified Shepard interpolation algorithm to select data points: only the closest 3D nodes whithin the user-specified
radius will be used.
m1 = table("Table1").convertToMatrixRandomXYZ("Data", 0, 100, 400, 500, 2.5)
The QtiPlot Handbook 366 / 452

The last five arguments of this method are optional and have "reasonable" default values. You only need to specify the name or
the number of the Z column like in the examples bellow:
t = table("Table1")
m1 = t.convertToMatrixRandomXYZ("Data")
m2 = t.convertToMatrixRandomXYZ(2)

7.2.13 Stem Plots

A stem-plot (or stem-and-leaf plot), in statistics, is a device for presenting quantitative data in a graphical format, similar to a
histogram, to assist in visualizing the shape of a distribution. A basic stem-plot contains two columns separated by a vertical
line. The left column contains the stems and the right column contains the leaves. See Wikipedia for more details.
QtiPlot provides a text representation of a stem-plot. The following function returns a string of characters representing the
statistical analysis of the data:
text = stemPlot(Table *t, columnName, power = 1001, startRow = 0, endRow = -1)

where the power variable is used to specify the stem unit as a power of 10. If this parameter is greater than 1000 (the default
behavior), than QtiPlot will try to guess the stem unit from the input data and will pop-up a dialog asking you to confirm the
automatically detected stem unit.
Once you have created the string representation of the stem-plot, you can display it in any text editor you like: in a note within
the project or even in the results log:
resultsLog().append(stemPlot(table("Table1"), "Table1_2", 1, 2, 15))

7.2.14 2D Plots

Graph windows usually display several plot layers. It is possible to get a reference to the active layer:
l = g.activeLayer()

but you can also select a layer by its number:


l = g.layer(num)

The default background color of a graph is white, but it is possible to fill it with a different background color or with a linear
gradient brush, using:
g = graph("Graph1")
g.setBackgroundColor(QtGui.QColor(Qt.gray))
g.setGradientBrush(2, 100) # one color gradient
g.setGradientBrush(3, QtGui.QColor(Qt.blue)) # two colors gradient

7.2.14.1 The plot title

l.setTitle("My beautiful plot")


l.setTitleFont(QtGui.QFont("Arial", 12))
l.setTitleColor(Qt.red)
l.setTitleAlignment(QtCore.Qt.AlignLeft)

The alignment parameter can be any combination of the Qt alignment flags (see the Qt documentation for more details).
If you want you can remove the plot title using:
l.removeTitle()
The QtiPlot Handbook 367 / 452

You can access the plot title properties using the following getter functions:
print l.titleString()
font = l.titleFont()
color = l.titleColor()
alignment = l.titleAlignment()

Here’s how you can add greek symbols in the plot title or in any other text in the plot layer: axis labels, legends:

l.setTitle("normal text <font face=\"Symbol\">greek text</font>")

Using the font specifications, you can also change the color of some parts of the title only:

l=newGraph().activeLayer()
l.setTitle("<font color = red>red</font> <font color = yellow>yellow</font> <font color = ←-
blue>blue</font>")

7.2.14.2 Customizing the axes

Layer axes can be shown/hidden using the following function:


l.enableAxis(int axis, on = True)

where axis can be any integer value between 0 and 3 or the equivalent reserved word:

0. Layer.Left
1. Layer.Right
2. Layer.Bottom
3. Layer.Top

The X-Y axes of a plot layer can be exchanged using the following function:
l.exchangeXYAxes()

The layout of the axes can be customized using the function bellow:
l.setAxesLayout(Layer.BottomVerticalLayout, 50, 30)

There are four predefined axes layouts available:

Layer.SideAxesLayout (0) It is the classical layout, the axes are displayed alongside the canvas drawing area.
Layer.CrossingAxesLayout (1) Two crossing axes, one vertical and one horizontal, are drawn inside the layer canvas. Their
positions can be customized using the 2nd and 3rd arguments of the setAxesLayout() method as a percentage of the canvas
size.
Layer.BottomVerticalLayout (2) Two axes are displayed: the bottom axis and a vertical axis inside the layer canvas. The
position of the vertical axis can be customized using the 3rd argument of the setAxesLayout() method which represents a
percentage of the length of the bottom axis.
Layer.LeftHorizontalLayout (3) Two axes are displayed: the left axis and a horizontal axis inside the layer canvas. The
position of the horizontal axis can be customized using the 2nd argument of the setAxesLayout() method which represents
a percentage of the length of the left axis.
The QtiPlot Handbook 368 / 452

If an axis is enabled, you can fully customize it via a Python script. For example you can set its title:
l.setAxisTitle(Layer.Bottom, "time (ms)")
l.setAxisTitleFont(Layer.Bottom, QtGui.QFont("Arial", 11))
l.setAxisTitleColor(Layer.Bottom, Qt.blue)
l.setAxisTitleAlignment(Layer.Bottom, Qt.AlignRight)
l.setAxisTitleDistance(Layer.Bottom, 20)

its color and the font used for the tick labels:
l.setAxisColor(Layer.Left, Qt.green)
l.setAxisFont(Layer.Left, QtGui.QFont("Arial", 10))

You can access the axis title properties using the following getter functions:
print l.axisTitleString(Layer.Bottom)
font = l.axisTitleFont(Layer.Top)
color = l.axisTitleColor(Layer.Right)
alignment = l.axisTitleAlignment(Layer.Left)
dist = l.axisTitleDistance(Layer.Left)

The other axis properties can be retrieved using the following methods:
font = l.axisFont(Layer.Top)
color = l.axisColor(Layer.Right)
formula = l.axisFormula(Layer.Bottom)

The tick labels of an axis can be enabled or disabled, you can set their color and their rotation angle:
l.enableAxisLabels(axis, on = True)
l.setAxisLabelsColor(Layer.Bottom, Qt.red)
l.setAxisLabelRotation(Layer.Bottom, 90)

angle can be any integer value between -90 and 90 degrees.


The properties of the axis labels can be retrieved using:
color = l.axisLabelsColor(Layer.Left)
angle = l.axisLabelsRotation(Layer.Left)

The numerical format of the labels can be set using:


l.setAxisNumericFormat(axis, format, precision = 6, formula)

where format can have the following values:

0. Automatic: the most compact numeric representation is chosen.


1. Decimal: numbers are displayed in floating point form.
2. Scientific lower case exponential notation, e.g.: 1.0e+04.
3. Superscripts: like Scientific, but the exponential part is displayed as a power of 10.
4. Engineering format, e.g: 10k.
5. Superscripts: like Superscripts above, but the multiplication sign is replaced by a dot sign.
6. Scientific upper case exponential notation, e.g.: 1.0E+04.

precision is the number of significant digits and formula is a mathematical expression that can be used to link opposite
scales. It’s argument must be x for horizontal axes and y for vertical axes. For example, assuming that the bottom axis displays
a range of wavelengths in nanometers and that the top axis represents the equivalent energies in eV, with the help of the code
below all the wavelengths will be automatically converted to electron-volts and the result will be displayed in floating point form
with two significant digits after the decimal dot sign:
The QtiPlot Handbook 369 / 452

l.setAxisNumericFormat(Layer.Top, 1, 2, "1239.8419/x")
print l.axisFormula(Layer.Top)

The axis ticks can be customized via the following functions:


l.setTicksLength(minLength, majLength)
print l.minorTickLength()
print l.majorTickLength()

l.setMajorTicksType(axis, majTicksType)
l.setMinorTicksType(axis, minTicksType)
l.setAxisTicksLength(axis, majTicksType, minTicksType, minLength, majLength)

where the majTicksType and minTicksType parameters specify the desired orientation for the major and minor ticks,
respectively:

0. Layer.NoTicks
1. Layer.Out: outward orientation for ticks, with respect to the plot canvas

2. Layer.InOut: both inward and outward ticks


3. Layer.In: inward ticks

minLength specifies the length of the minor ticks, in pixels and majLength the length of the major ticks.
You can also customize the scales of the different axes using:
l.setScale(int axis, double start, double end, double step=0.0, int majorTicks=5, int ←-
minorTicks=5, int type=0, bool inverted=False)

where type specifies the desired scale type:

0. Layer.Linear
1. Layer.Log10

2. Layer.Ln
3. Layer.Log2
4. Layer.Reciprocal
5. Layer.Probability

6. Layer.Logit

and step defines the size of the interval between the major scale ticks. If not specified (default value is 0.0), the step size is
calculated automatically. The other flags should be self-explanatory.
It is possible to access the scale type of an axis via the following "getter" function:
print l.axisScaleType(Layer.Bottom)

The type of an axis (Numerical, Day, Month, Date/Time, etc...) can be obtained using:
print l.axisType(Layer.Bottom)

It is possible to get information about the scale division of an axis via the following functions:
The QtiPlot Handbook 370 / 452

div = graph("Graph1").activeLayer().axisScaleDiv(Layer.Left)
print div.lowerBound()
print div.upperBound()
print div.range()

Defining a scale range for an axis doesn’t automatically disable autoscaling. This means that if a curve is added or removed from
the layer, the axes will still automatically adapt to the new data interval. This can be avoided by disabling the autoscaling mode,
thus making sure that your scale settings will always be taken into account:
l.enableAutoscaling(False)
l.setSynchronizedScaleDivisions(False)

If you want to rescale the plot layer so that all the data points are visible, you can use the following utility function:
l.setAutoScale()

The same setScale function above, with a longer list of arguments, can be used to define an axis break region:
l.setScale(axis, start, end, step=0.0, majorTicks=5, minorTicks=5, type=0, inverted=False,
left=-DBL_MAX, right=DBL_MAX, breakPosition=50, stepBeforeBreak=0.0, stepAfterBreak=0.0,
minTicksBeforeBreak=4, minTicksAfterBreak=4, log10AfterBreak=False, breakWidth=4, ←-
breakDecoration=True)

where left specifies the left limit of the break region, right the right limit, breakPosition is the position of the break
expressed as a percentage of the axis length and breakWidth is the width of the break region in pixels. The names of the other
parameters should be self-explanatory.
You can also invert the scale of an axis using the following direct method:
l.invertScale(Layer.Bottom)
print l.hasInvertedScale(Layer.Bottom)

Finally, you can specify the width of all axes and enable/disable the drawing of their backbone line, using:
l.setAxesLinewidth(2)
l.drawAxesBackbones(True)

7.2.14.3 The canvas

You can display a rectangular frame around the drawing area of the plot (the canvas) and fill it with a background color, a linear
gradient brush or with an image, using:
l.setCanvasFrame(2, QtGui.QColor("red"))
l.setCanvasColor(QtGui.QColor("lightGrey"))
l.setCanvasGradientBrush(3, QtGui.QColor(Qt.blue))
l.setCanvasBackgroundImage("C:/qtiplot/qtiplot/qtiplot_logo.png")

As you have seen above it is possible to fill the canvas with a linear gradient brush. There are sixteen predefined gradient types.
The first argument of the "setter" functions is the gradient type and must be a value between 0 and 15. The second argument
can be either a color or an integer value. If the second argument is a color the linear gradient interpolates between the canvas
background color and the specified color. If you specify an integer value (the lightness) the second color of the linear gradient
is a lighter/darker color with respect to the background color. The lightness must be an integer value between 0 (black) and 100
(white).
l.setCanvasGradientBrush(3, QtGui.QColor(Qt.blue))
l.setCanvasGradientBrush(3, 90)

The following access methods are available for the canvas background image:
The QtiPlot Handbook 371 / 452

pic = l.backgroundPixmap() # QPixmap


path = l.canvasBackgroundFileName()

Drawing the canvas frame and disabling the axes backbone lines is the only possible solution for the issue of axes not touching
themselves at their ends.

7.2.14.4 The layer frame

You can display a rectangular frame around the whole layer and fill it with a background color or with a linear gradient brush,
using:
l.setFrame(2, QtGui.QColor("blue"))
l.setBackgroundColor(QtGui.QColor("grey"))
l.setGradientBrush(3, QtGui.QColor(Qt.blue))

The default spacing between the layer frame and the other layer elements (axes, title) can be changed via:
l.setMargin(10)

7.2.14.5 Customizing the grid

You can display or hide the grid associated to a layer axis or the whole grid using the functions bellow:
l.showGrid()
l.hideGrid()
l.showGrid(axis)
l.hideGrid(axis)
l.setGridOnTop(on = True, update = True) # draw grid on top of data

This will display the grid with the default color, width and pen style settings. If you need to change these settings, as well as to
enable/disable certain grid lines, you can use the following functions:
grid = l.grid()
grid.setMajPenX(QtGui.QPen(QtCore.Qt.red, 1))
grid.setMinPenX(QtGui.QPen(QtCore.Qt.yellow, 1, QtCore.Qt.DotLine))
grid.setMajPenY(QtGui.QPen(QtCore.Qt.green, 1))
grid.setMinPenY(QtGui.QPen(QtCore.Qt.blue, 1, QtCore.Qt.DashDotLine))
grid.enableXMaj()
grid.enableXMin()
grid.enableYMaj(False)
grid.enableYMin(False)
grid.enableZeroLineX(True)
grid.enableZeroLineY(False)
grid.setXZeroLinePen(QtGui.QPen(QtCore.Qt.black, 2))
grid.setYZeroLinePen(QtGui.QPen(QtCore.Qt.black, 2))
l.replot()

All the grid functions containing an X refer to the vertical grid lines, whereas the Y letter indicates the horizontal ones. Also, the
Maj word refers to the main grid lines and Min to the secondary grid.

7.2.14.6 The plot legend

Plot legends can be accessed as shown in the script bellow. You should be aware of the fact that not all plot layers have legends.
If the legend object was deleted, the instance returned by the legend() function might be null:
The QtiPlot Handbook 372 / 452

layer = graph("Graph1").activeLayer()
legend = layer.legend()
if legend: # the current legend might be NULL
legend.setOrigin(100, 80)
else:
print "This layer doesn’t have a legend!"

You can add a new legend to a plot using:


legend = l.newLegend()
#or
legend = l.newLegend("enter your text here")

The legend of a plot layer can be removed using:


l.removeLegend()

Plot legends are special text objects which are updated each time you add or remove a curve from the layer. They have a special
auto-update flag which is enabled by default. The following function returns True for a legend object:
legend.isAutoUpdateEnabled()

You can disable/enable the auto-update behavior of a legend/text object using:


legend.setAutoUpdate(False/True)

You can add common texts like this:


text = l.addText(legend)
text.setOrigin(legend.x(), legend.y()+50)

Please notice that the addText function returns a different reference to the new text object. You can use this new reference later
on in order to remove the text:
l.remove(text)

Once you have created a legend/text, it’s very easy to customize it. If you want to modify the text you can use:
legend.setText("Enter your text here")

All other properties of the legend: rotation angle, text color, background color, frame style, font and position of the top-left corner
can be modified via the following functions:
legend.setAngle(90)
legend.setTextColor(QtGui.QColor("red"))
legend.setBackgroundColor(QtGui.QColor("yellow"))
legend.setFrameStyle(Frame.Shadow)
legend.setFrameColor(QtCore.Qt.red)
legend.setFrameWidth(3)
legend.setFrameLineStyle(QtCore.Qt.DotLine)
legend.setFont(QtGui.QFont("Arial", 14, QtGui.QFont.Bold, True))
# set top-left position using scale coordinates:
legend.setOriginCoord(200.5, 600.32)
# or set top-left position using pixel coordinates:
legend.setOrigin(5, 10)
legend.repaint()

Some of the properties of the legend can be accessed via the following "getter" functions:
The QtiPlot Handbook 373 / 452

angle = legend.angle()
color = legend.textColor()
font = legend.font()
x = legend.xValue()# top position in scale coordinates
y = legend.yValue()# left position in scale coordinates

Other frame styles available for legends are: Legend.Line, which draws a rectangle around the text and Legend.None (no
frame at all). There is also a function allowing you to add an automatically built time stamp:
timeStamp = l.addTimeStamp()

Finally, it is possible to iterate over the list of all texts/legends in a plot layer:
layer = graph("Graph1").activeLayer()
for legend in layer.textsList():
print legend.text()

7.2.14.7 Antialiasing

Antialiasing can be enabled/disabled for the drawing of the curves and other layer objects, but it is a very resources consuming
feature:
l.setAntialiasing(True, bool update = True)

7.2.14.8 Resizing layers

A layer can be resized using the methods below, where the first argument is the new width, the second is the new height and sizes
are defined in pixels:
l.resize(200, 200)
l.resize(QSize(w, h))

If you also need to reposition the layer, you can use the following functions, where the first two arguments specify the new
position of the top left corner of the canvas:
l.setGeometry(100, 100, 200, 200)
l.setGeometry(QRect(x, y, w, h))

By default, when resizing 2D plot windows, QtiPlot adapts the sizes and aspect of the layers to the new size of the plot window.
You can override this behavior and keep the aspect and size of the graph layers unchanged:
g = newGraph("test", 2, 1, 2)
g.arrangeLayers()
g.setScaleLayersOnResize(False)

Also, the default behavior of 2D plot layers with respect to the resizing of the graph window is to adapt the sizes of the fonts used
for the various texts, to the new size of the plot window. You can override this behavior and keep the size of the fonts unchanged:
l.setAutoscaleFonts(False)
The QtiPlot Handbook 374 / 452

7.2.14.9 Resizing the drawing area

The drawing area of a layer (the canvas) can be resized using the methods below, where the first argument is the new width, the
second is the new height and sizes are defined in pixels:
l.setCanvasSize(200, 200)
l.setCanvasSize(QSize(w, h))

If you also need to reposition the canvas, you can use the following functions, where the first two arguments specify the new
position of the top left corner of the canvas:
l.setCanvasGeometry(100, 100, 200, 200)
l.setCanvasGeometry(QRect(x, y, w, h))

Please keep in mind that the fonts of the layer are not rescaled when you resize the layer canvas using the above methods.

7.2.14.10 Working with 2D curves

If you want to create a new Graph window for some data in table Table1, you can use the plot command:
t = table("Table1")
g = plot(t, column, type)

column can be either the name of the column (string value) or the column index (integer value) and type specifies the desired
plot type and can be one of the following numbers or the equivalent reserved word:

0 Layer.Line
1 Layer.Scatter
2 Layer.LineSymbols
3 Layer.VerticalBars
4 Layer.Area
5 Layer.Pie
6 Layer.VerticalDropLines
7 Layer.Spline
8 Layer.HorizontalSteps
9 Layer.Histogram
10 Layer.HorizontalBars
13 Layer.Box
15 Layer.VerticalSteps
23 Layer.BSpline
24 Layer.Bezier
33 Layer.AkimaSpline
39 Layer.IntervalPlot
40 Layer.Violin
41 Layer.ViolinBox
The QtiPlot Handbook 375 / 452

42 Layer.ScatterInterval
43 Layer.BoxDataOverlap
44 Layer.Ridgeline

You can plot more than one column at once by giving a Python tuple (see the Python Tutorial) as an argument:
g1 = plot(table("Table1"), (2,4,7), 2)
g2 = plot(table("Table1"), ("Table1_2","Table1_3"), Layer.LineSymbols)

There are some curve types that specifically request at least two Y columns, the first column in the tuple being used as baseline:

26 Layer.FloatingColumn
27 Layer.FloatingBar
29 Layer.FillArea

l.addCurves(table("Table1"), (2, 3), Layer.FloatingColumn)


l.addCurves(table("Table1"), (2, 3), Layer.FillArea)

Some predefined plot types that can be used to stack the plot curves by adding an offset to their Y values:

21 Layer.StackBar
22 Layer.StackColumn
25 Layer.StackArea
28 Layer.StackLine
30 Layer.StackBarPercent
31 Layer.StackColumnPercent
32 Layer.StackAreaPercent

l.addCurves(table("Table1"), (2, 3), Layer.StackColumn)

The stack offset can be customized using one of the following modes:

0 Layer.NoOffset
1 Layer.CumulativeOffset
2 Layer.ConstantOffset
3 Layer.AutoOffset
4 Layer.IndividualOffset

l.addCurves(table("Table1"), (2, 3), Layer.StackLine)


l.stackCurves(Layer.AutoOffset, 0.1)

In the example above the relative gap between the plot curves was set to 10% (0.1). The offset can be set to a constant value if
the stack mode is set to Layer.ConstantOffset:
l.addCurves(table("Table1"), (2, 3), Layer.Line)
l.stackCurves(Layer.ConstantOffset, 1000)
The QtiPlot Handbook 376 / 452

or you can specify a different offset for each plot curve:


l.addCurves(table("Book1"), ("B", "C"), Layer.Area)
l.stackCurves(Layer.IndividualOffset)
c = l.dataCurve(1)
c.setOffset(2, 500)
print c.xOffset(), c.yOffset()

In the case of the following plot types: StackAreaPercent, StackBarPercent and StackColumnPercent the stack
mode is set to CumulativeOffset and the data values are percent normalized. A special hasPercentNormalizedStack
flag is set for these plot types:
print l.hasPercentNormalizedStack()

which of course can be disabled:


l.setPercentNormalizedStack(False)
l.stackCurves(Layer.CumulativeOffset)

You can add or remove curves to or from a plot layer:


l.insertCurve(table, Ycolumn, type=Layer.Scatter, int startRow = 0, int endRow = -1)# ←-
returns a reference to the inserted curve
l.insertCurve(table, Xcolumn, Ycolumn, type=Layer.Scatter, int startRow = 0, int endRow = ←-
-1)# returns a reference to the inserted curve
l.addCurve(table, column, type=Layer.Line, lineWidth = 1, symbolSize = 3, startRow = 0, ←-
endRow = -1)# returns True on success
l.addCurves(table, (2,4), type=Layer.Line, lineWidth = 1, symbolSize = 3, startRow = 0, ←-
endRow = -1)# returns True on success
l.removeCurve(curveName)
l.removeCurve(curveIndex)
l.removeCurve(curveReference)
l.deleteFitCurves()

It is possible to copy all the curves from a source plot layer, lSrc, to a destination layer lDst:
lSrc = graph("Graph1").activeLayer()
lDst = newGraph().activeLayer()
lDst.copyCurves(lSrc)

Of course, you can also fully clone an entire plot layer:


lDst.copy(lSrc)

Please note that it is possible to copy only the format of a plot layer without affecting the data source of the curves:
lDst.copy(lSrc, False) # copy only the format of the curves, not the data

It is possible to change the order of the curves inserted in a layer using the following functions:
l.changeCurveIndex(int oldIndex, int newIndex)
l.reverseCurveOrder()

You can also change the Z order of the curves:


l.switchCurveZ(int oldIndex, int newIndex);
l.reverseCurveZOrder()

If the table column used to create a plot curve has empty cells, you can choose whether the curve line is drawn connected across
the missing data or not. This behavior can be specified using:
l.showMissingDataGap(on = True, replot = True)
The QtiPlot Handbook 377 / 452

Sometimes, when performing data analysis, one might need the curve title. It is possible to obtain it using the method below:
title = l.curveTitle(curveIndex)

It is possible to get a reference to a curve on the layer l using it’s index or it’s title, like shown below:
c = l.curve(curveIndex)
c = l.curve(curveTitle)
dc = l.dataCurve(curveIndex)

Please, keep in mind the fact that the above methods might return an invalid reference if the curve with the specified index/title is
not a PlotCurve or a DataCurve object, respectively. For example, an analytical function curve is a PlotCurve but not a
DataCurve and spectrograms are a completely different type of plot items which are neither PlotCurves nor DataCurves.
Once you have a reference to a PlotCurve c it is possible to get its type and title using the methods bellow:
c = graph("Graph1").activeLayer().curve(0)
print c.type()
print c.name()

Use the following functions to change the axis attachment of a curve:


l.setCurveAxes(index, xAxis, yAxis)
c.setXAxis(xAxis)
c.setYAxis(yAxis)

where index is the index of the curve (starting at zero), xAxis can be either Layer.Bottom or Layer.Top and yAxis
can be either Layer.Left or Layer.Right:
l.setCurveAxes(0, Layer.Top, Layer.Right)# modify the first curve in the layer
c.setXAxis(Layer.Bottom)
c.setYAxis(Layer.Right)#attach curve c to the right Y axis

The following functions give information about the axes to which a curve is attached:
print c.xAxis()
print c.yAxis()

In case you need the number of curves on a layer, you can get it with
l.numCurves()

It is possible to change the number of symbols to be displayed for a curve using the function below. This option can be very
usefull for very large data sets:
c.setSkipSymbolsCount(3)
print c.skipSymbolsCount()

Once you have added a curve to a plot layer you can fully customize it’s appearance:
l = newGraph().activeLayer()
l.setAntialiasing()
c = l.insertCurve(table("Table1"), "Table1_2", Layer.LineSymbols)
c.setPen(QPen(Qt.red, 3))
c.setBrush(QBrush(Qt.darkYellow))
c.setFillAreaColor(Qt.green)
c.setGradientBrush(3, QColor(Qt.blue))
c.setSymbol(PlotSymbol(PlotSymbol.Hexagon,QBrush(Qt.cyan),QPen(Qt.blue,1.5),QSize(15,15)))
c.setLineStyle(PlotCurve.AkimaSpline)

A curve can be customized using one of the following line styles:


The QtiPlot Handbook 378 / 452

0 PlotCurve.NoCurve: the line is not drawn


1 PlotCurve.Lines: a simple line
2 PlotCurve.Sticks: vertical drop lines

3 PlotCurve.HorizontalSteps: a horizontal stepped line


4 PlotCurve.Dots: the line is drawn as a series of dots
5 PlotCurve.Spline: a normal spline

6 PlotCurve.VerticalSteps: a vertical stepped line


7 PlotCurve.BSpline:a B-spline (or basis spline)
8 PlotCurve.Bezier: Bezier spline
9 PlotCurve.AkimaSpline: the line is drawn as an Akima interpolation

An alternative way of customizing a curve in terms of color, line width and line style is by using the functions below, where the
first argument is the curve index:
l.setCurveLineColor(0, QtGui.QColor(Qt.red))
# or set color by its index in the default color list: 0=black, 1=red, 2=green,...:
l.setCurveLineColor(0, 1)
l.setCurveLineStyle(0, Qt.DashLine)
l.setCurveLineWidth(0, 0.5) # set the linewidth to 0.5

Here’s a short script showing these functions at work:


t = newTable("test", 30, 4)
for i in range(1, t.numRows()+1):
t.setCell(1, i, i)
t.setCell(2, i, i)
t.setCell(3, i, i+2)
t.setCell(4, i, i+4)

l = qti.app.plot(t, (2,3,4), Layer.Line).activeLayer() # plot columns 2, 3 and 4


for i in range(0, l.numCurves()):
l.setCurveLineColor(i, 1 + i)
l.setCurveLineWidth(i, 0.5 + i)
l.setCurveLineStyle(1, 1 + i)

It is possible to define a global color policy for the plot layer using the following convenience functions:
l.setGrayScale()
# use colors from a linear gradient
l.setGradientColorScale(Qt.yellow, Qt.cyan)
# use colors from the default color list: 0 = black, 1 = red, 2 = green, etc...:
l.setIndexedColors()
# use a linear color map
map = LinearColorMap.rainbowMap()
map.setIntensityRange(1, l.curveCount())
l.setColorMap(map)

Other useful functions allowing to edit the style of all the curves in a plot layer with a single call are:
l.incrementLineStyle()
l.incrementFillPattern()

If you need to change the range of data points displayed in a DataCurve you can use the following methods:
The QtiPlot Handbook 379 / 452

c.setRowRange(int startRow, int endRow)


c.setFullRange()

Also, you can hide/show a plot curve via:


c.setVisible(bool on)

7.2.14.11 Curve baseline

When you define a filling brush for the area beneath a plot curve the baseline of the filling area is by default the line y = 0.
Nevertheless you can specify a different y value to be the baseline reference:
c = newGraph().activeLayer().addFunction("sin(x)", 0, 2*pi, 100)
c.setBrush(QColor(255, 0, 0, 100))
c.setBaseline(0.5)
print c.baseline()

You can also specify a different plot curve to act as a custom baseline:
l = newGraph().activeLayer()
c1 = l.addFunction("sin(x)", 0, 2*pi, 100)
c2 = l.addFunction("cos(x)", 0, 2*pi, 100)
c2.setBrush(QBrush(Qt.darkYellow))
c2.setBaselineCurve(c1)
print c2.baselineCurve().name()

In the case of DataCurves you can also specify a data column as the custom baseline:
c.setBaselineColumn("Table1_2") # the data source of curve c is table "Table1"
print c.baselineColumnName()

7.2.14.12 Curve values

In case you need information about the data stored in a plot curve, the functions bellow return Python lists containing the abscissas
and the ordinates of all the data points:
abscissaList = c.xValues()
ordinateList = c.yValues()

Or you have at your disposal functions that give access to the values of the individual data points:
points = c.dataSize()
for i in range (0, points):
print i, "x = ", c.x(i), "y = ", c.y(i)

You can also get information about the range (minimum and maximum values) of the data stored in a 2D plot curve:
print c.minXValue()
print c.maxXValue()
print c.minYValue()
print c.maxYValue()

It is also possible to get references to the data table and data column objects used to create a DataCurve. Please note that the
reference to the column containing the abscissas may be null for some data curves:
dc = graph("Graph1").activeLayer().dataCurve(0)
t = dc.table()
xCol = dc.xColumn() # abscissas column
yCol = dc.yColumn() # ordinates column
print xCol.index(), xCol.fullName(), yCol.index(), yCol.fullName()
print t.objectName()
The QtiPlot Handbook 380 / 452

7.2.14.13 Curve symbols

Here’s how you can customize the plot symbol used for a 2D plot curve c:
s = c.symbol()
s.setSize(QtCore.QSize(7, 7))# or s.setSize(7)
s.setBrush(QtGui.QBrush(Qt.darkYellow))
s.setPen(QtGui.QPen(Qt.blue, 3))
s.setStyle(PlotSymbol.Diamond)
l.replot() # redraw the plot layer object

The symbol styles available in QtiPlot are:

-1 PlotSymbol.NoSymbol
0 PlotSymbol.Ellipse

1 PlotSymbol.Rect
2 PlotSymbol.Diamond
3 PlotSymbol.Triangle

4 PlotSymbol.DTriangle
5 PlotSymbol.UTriangle
6 PlotSymbol.LTriangle
7 PlotSymbol.RTriangle

8 PlotSymbol.Cross
9 PlotSymbol.XCross
10 PlotSymbol.HLine
11 PlotSymbol.VLine

12 PlotSymbol.Star1
13 PlotSymbol.Star2
14 PlotSymbol.Hexagon

15 PlotSymbol.Pentagon
16 PlotSymbol.Star3

If the the shape of the symbol is an ellipse (a circle in fact), the setCircleSizeType method lets you choose how the area
of the symbols is determined from their defined size. Three options are available:

0 PlotCurve.BasedOnSquare: The area is calculated as the area of the square enclosing the circle (A = Size*Size).

1 PlotCurve.BasedOnDiameter: The diameter of the circle equals the value defined for Size (A = Pi*Size*Size/4).
2 PlotCurve.BasedOnArea: The area of the circle equals the value defined for the Size (A = Size).

g = graph("Graph1").activeLayer()
c = g.curve(0)
c.setCircleSizeType(PlotCurve.BasedOnArea)
g.replot()
The QtiPlot Handbook 381 / 452

It is worth knowing that you can define a custom image as the plot symbol for a curve:
g = newGraph().activeLayer()
c = g.addFunction("cos(x)", 0, 10, 20)
c.setSymbol(ImageSymbol("qtiplot/manual/html/icons/help.png"))

Here’s a short script showing how to draw a custom plot symbol and assign it to a curve:
pix = QtGui.QPixmap(QtCore.QSize(11, 11))
pix.fill(Qt.transparent)
p = QtGui.QPainter(pix)
r = QtCore.QRect(0, 0, 10, 10)
p.drawEllipse(r)
p.setPen(QtGui.QPen(Qt.red))
p.drawLine(5, 0, 5, 10)
p.drawLine(0, 5, 10, 5)
p.end()

g = newGraph().activeLayer()
c = g.addFunction("sin(x)", 0, 10, 20)
c.setSymbol(ImageSymbol(pix))

You can also use Unicode characters as plot symbols for a curve:
g = newGraph().activeLayer()
c = g.addFunction("sin(x)", 0, 10, 20)
symbol = UnicodeSymbol(0x273D)
symbol.setFontSize(22)
symbol.setPen(Qt.red)
c.setSymbol(symbol)

It is also possible to define variable sizes for the symbols of a plot curve by indexing the cell values from a table column. This
special column can be specified via the setSymbolSizeColumn method. Additionally you may set a scaling factor for the
symbol size like in the small script bellow:
t = table("Table1")
g = qti.app.plot(t, "Table1_2", Layer.Scatter).activeLayer()
c = g.curve(0)
c.setSymbolSizeColumn(t.column(3))
c.setSymbolScalingFactor(15)
print c.symbolSizeColumn().fullName(), c.symbolScalingFactor()

An equivalent way of obtaining the same result as with the script above is to use the specialized function plotBubbles. You
need to specify two Y columns as argument of this function. The first Y column in the tuple is used for the positions of the plot
symbols and the next one determines their sizes, see the example bellow:
c = newGraph().activeLayer().plotBubbles(table("Table1"), ["2", "3"])
print c.symbolSizeColumn().fullName(), c.symbolScalingFactor()

It is also possible to define a default color map for the plot symbols using the values from a table column. Both the filling color
and the edge color can be customized, using the functions bellow:
g = graph("Graph1").activeLayer()
c = g.curve(0)
t = table("Table1")
c.setSymbolEdgeColorColumn(t.column(2))
c.setSymbolFillColorColumn(t.column(3))
g.replot()

print c.symbolEdgeColorColumn().fullName(), c.symbolFillColorColumn().fullName()

The default color map of a plot curve can be modified like shown in the script bellow:
The QtiPlot Handbook 382 / 452

g = graph("Graph1").activeLayer()
c = g.curve(0)
map = c.colorMap()
map.setColorInterval(Qt.blue, Qt.yellow)
map.addColorStop(0.5, Qt.red)
c.setColorMap(map)
g.replot()

The convenience function setColorMapIntensityRangeFromColumn can be used in order to modify the intensity range
of the color map. This function finds the minimum and maximum values in the specified column and confines the intensity range
between this interval:
g = graph("Graph1").activeLayer()
c = g.curve(0)
c.setColorMapIntensityRangeFromColumn(table("Table1").column(3))
g.replot()

The specialized functions plotColorMappedSymbols and plotColorMappedBubbles can also be used in order to get
a 2D plot curve displaying color mapped symbols. You need to specify at least two Y columns for these functions: the first
is used for the positions of the plot symbols and the second determines their color. QtiPlot finds the minimum and maximum
values in the second Y column, creates eight evenly sized ranges of values between the minimum and maximum values, and then
associates a color with each range of values. The color of each data point is determined by finding the color associated with the
second Y column value in the color map.
g = newGraph().activeLayer()
c = g.plotColorMappedSymbols(table("Table1"), ["2", "3"])
c.symbol().setSize(10)

The plotColorMappedBubbles function also accepts a tuple of three columns: the first is used for the positions of the plot
symbols, the second determines their sizes and the third the color of their edges. This function automatically sets the filling color
of the plot symbols to white.
g = newGraph().activeLayer()
c = g.plotColorMappedBubbles(table("Table1"), ["2", "3", "4"])
print c.symbolScalingFactor()

Alternatively, in order to get the same graphs, you can use the addCurves function and the following curve types:

34 Layer.Bubble
34 Layer.ColorMappedSymbols
36 Layer.ColorMappedBubbles

But instead of a direct reference to the newly created plot curve this function returns a boolean result:
g = newGraph().activeLayer()
ok = g.addCurves(table("Table1"), (2, 3, 4), Layer.ColorMappedSymbols, 0, 10)
print ok # prints True on success

7.2.14.14 Curve labels

It is possible to display labels for each data point in a DataCurve. The labels can be set using the method bellow:
c.setLabelsForm(DataCurve.YValues)

and may have one of the following predefined forms:


The QtiPlot Handbook 383 / 452

0 DataCurve.XValues
1 DataCurve.YValues
2 DataCurve.RowIndices
3 DataCurve.XYValues

You may also specify the labels using the texts in a table column:
c.setLabelsColumnName("Table1_2")

If the labels have numerical values, you can change their display format and precision:
c.setLabelsNumericFormat(2, 3)# display labels with scientific format and three significant ←-
digits
c.setLabelsNumericPrecision(2)

The available formats are:

0. Automatic: the most compact numeric representation is chosen


1. Decimal: numbers are displayed in floating point form (10.000)
2. Scientific: numbers are displayed using the exponential notation (1e4)

The position of the labels can be set using the method bellow:
c.setLabelsAlignment(DataCurve.Right)

The following predefined positions can be used:

0 DataCurve.Center
1 DataCurve.Left
2 DataCurve.Right
3 DataCurve.Above
4 DataCurve.Bellow

If the data curve is a column/bar/histogram curve the following predefined positions should be used instead:

0 DataCurve.Center
1 DataCurve.InsideEnd
2 DataCurve.InsideBase
3 DataCurve.OutsideEnd

Other properties of the labels can be customized using the functions bellow:
c.setLabelsOffset(50, 50)
c.setLabelsColor(Qt.red)
c.setLabelsFont(QtGui.QFont("Arial", 14))
c.setLabelsRotation(45)

You can disable the labels of a data curve using:


c.clearLabels()
l.replot() # redraw the plot layer object
The QtiPlot Handbook 384 / 452

7.2.14.15 Curve drop shadow

It is possible to enable/disable the display of drop shadows for all curves in a plot layer at once:
g = graph("Graph1").activeLayer()
# set shadow color to light gray, offset to 5 pixels and blur radius to 8
g.setDropShadowProperties(Qt.lightGray, 5, 8.0)
g.enableCurveDropShadows(True)

It is equally possible to enable/disable the drop shadow effect for each curve individually:
g = graph("Graph1").activeLayer()
c = g.curve(0)
if (c.hasDropShadow()):
c.enableDropShadow(False)
g.replot()

7.2.14.16 Selecting a data range

You can activate the "Select Data Range" tool for a plot layer and select the active curve using the following method:
g = graph("Graph1").activeLayer()
g.enableRangeSelectors()
g.setSelectedCurve(g.curve(0))
g.setActivePoint(20)
g.switchActiveMarker()
g.setActivePoint(90)
g.replot()

If a plot curve is selected you can get the coordinates of the selected data points like shown bellow:
c = g.selectedDataCurve()
ap = g.selectionActivePoint()
ip = g.selectionInactivePoint()
print c.x(ap), c.y(ap), c.x(ip), c.y(ip)

If the selected plot curve is also a DataCurve, meaning that it has a valid data source table, unlike analytical function curves, you
can have access to the row indices of the selected data points from the source table, using the tableRow method, like shown in
the script bellow. Please note that if the selected curve is an analytical function curve and you call the tableRow method this
will result in a crash.
c = g.selectedDataCurve()
print c.tableRow(g.selectionActivePoint()) + 1
print c.tableRow(g.selectionInactivePoint()) + 1

All 2D plot tools can be disabled using:


g.disableTools()

7.2.14.17 Analytical Functions

You can also add analytical function curves to a plot layer:


f = l.addFunction("x*sin(x)", 0, 3*pi, points = 100)
f.setTitle("x*sin(x)")
f.setPen(Qt.green)
f.setBrush(QtGui.QColor(0, 255, 0, 100))

l.addParametricFunction("cos(m)", "sin(m)", 0, 2*pi, points = 100, variableName = "m")


l.addPolarFunction("t", "t", 0, 2*pi, points = 100, variableName = "t")
The QtiPlot Handbook 385 / 452

It is possible to get a reference to an analytical function curve on the layer l using it’s index, like shown below:
f = l.functionCurve(curveIndex)

When dealing with analytical function curves, you can customize them using the following methods:
f.setRange(0, 2*pi)
f.setVariable("t")
f.setComment("My function")
f.setFormulas("sin(t)", "cos(t)")
f.setFunctionType(FunctionCurve.Polar) # or c.setFunctionType(FunctionCurve.Parametric)
f.loadData(1000, xLog10Scale = False)

f.setFunctionType(FunctionCurve.Normal)
f.setFormula("cos(x)")
f.loadData()

If you need to access the values and names of a function’s parameters, you have at your disposal the following methods:
i = f.parametersCount() # the number of parameters in your function formula
name = f.parameterName(index) # the name of the parameter of rang index as a QString
p1 = f.parameterValue(index) # the value of the parameter of rang index as a double
p2 = f.parameterValue(name) # the value of a parameter using its name string

The abscissae range for which the function is calculated/displayed, can be obtained/modified via the methods below:
x1 = f.startRange()
x2 = f.endRange()
f.setRange(0.5, 15.2)

7.2.14.18 Error Bars

Having a plot layer l, you can add error bars to a data curve c, named curveName, using the following methods:
err1 = l.addErrorBars(c, Table *t, QString errColName, int type = 1, double width = 1, int ←-
capLength = 8, color = Qt.black, throughSymbol = True, minusSide = True, plusSide = True ←-
)
err2 = l.addErrorBars(curveName, Table *t, QString errColName, int type = 1, double width = ←-
1, int capLength = 8, color = Qt.black, throughSymbol = True, minusSide = True, ←-
plusSide = True)

Each data curve, c, can have attached a list of error bars:


errors = c.errorBarsList()

The properties of an error bar curve can be accesses, via the following methods:
err = c.errorBarsList()[0]
for i in range(0, err.dataSize()):
print err.errorValue(i)

err.capLength()
err.width()
err.color()
err.direction()
err.xErrors()
err.throughSymbol()
err.plusSide()
err.minusSide()
c = err.masterCurve() # reference to the master curve to which the error bars curve is ←-
attached.
err.detachFromMasterCurve() # equivalent to c.removeErrorBars(err)
The QtiPlot Handbook 386 / 452

... and can be modified, via the following methods:


err.setCapLength(12)
err.setWidth(3)
err.setColor(Qt.red)
err.setDirection(ErrorBarsCurve.Vertical)
err.setXErrors(True) # equivalent to err.setDirection(ErrorBarsCurve.Horizontal)
err.drawThroughSymbol(True)
err.drawPlusSide(True)
err.drawMinusSide(False)
err.setMasterCurve(c)

You can remove all error bars attached to a curve using:


c.clearErrorBars()

7.2.14.19 Image and Contour Line Plots (Spectrograms)

As you have seen in the previous section, it is possible create 2D plots from matrices. Here’s how you can do it in practice:
m = importImage("C:/poze/adi/PIC00074.jpg")
g1 = plot(m, Layer.ColorMap)
g2 = plot(m, Layer.Contour)
g3 = plot(m, Layer.GrayScale)
g4 = plot(m, Layer.HeatMap)

The plot functions above return a reference to the multilayer plot window. If you need a reference to the spectrogram object
itself, you can get it as shown in the example below:
m = newMatrix("TestMatrix", 1000, 800)
m.setFormula("x*y")
m.calculate()
g = plot(m, Layer.ColorMap)
s = g.activeLayer().spectrogram(m)
s.setColorBarWidth(20)

It is possible to fine tune the plots created from a matrix:


m = newMatrix("TestMatrix", 1000, 800)
m.setFormula("x*y")
m.calculate()

s = newGraph().activeLayer().plotSpectrogram(m, Layer.ColorMap)
s.setContourLevels((20.0, 30.0, 60.0, 80.0))
s.setDefaultContourPen(QtGui.QPen(Qt.yellow)) # set global pen for the contour lines
s.setLabelsWhiteOut(True)
s.setLabelsColor(Qt.red)
s.setLabelsFont(QtGui.QFont("Arial", 14))
s.setLabelsRotation(45)
s.showColorScale(Layer.Top)
s.setColorBarWidth(20)

As you have seen earlier, you can set a global pen for the contour lines, using:
s.setDefaultContourPen(QtGui.QPen(Qt.yellow))

You can also assign a specific pen for each contour line, using the function below:
s.setContourLinePen(index, QPen)

or you can automatically set pen colors defined by the color map of the spectrogram:
The QtiPlot Handbook 387 / 452

s.setColorMapPen(bool on = True)

It is possible to customize the alpha channel of the image plot using the following functions:
# set alpha channel using an integer value between 0 (transparent) and 255 (opaque)
s.setAlpha(127)
print s.alpha()

# set alpha channel using a float value between 0.0 (transparent) and 1.0 (opaque)
s.setAlphaF(0.65)
print s.alphaF()

You can also use any of the following functions:


s.setMatrix(Matrix *, bool useFormula = False)
s.setUseMatrixFormula(bool useFormula = True)# calculate data to be drawn using matrix ←-
formula (if any)
s.setLevelsNumber(int)
s.showColorScale(int axis, bool on = True)
s.setGrayScale()
s.setDefaultColorMap()
s.setCustomColorMap(LinearColorMap map)
s.showContourLineLabels(bool show = True) # enable/disable contour line labels
s.setLabelsOffset(int x, int y) # offset values for all labels in % of the text size
s.updateData()

7.2.14.20 Analytical Spectrograms

It is possible to create 2D image and contour plots from analytical functions of two variables (x and y), without having to create
a matrix window first. Here’s how you can do it in practice:
g = newGraph().activeLayer()
f = "sin(x)*sin(y)"

s1 = g.addFunction2D(f, -2*pi, 0, 0, 2*pi, -1, 1)


s1.setTitle("Image and Contour Plot")

s2 = g.addFunction2D(f, 0, 2*pi, 0, 2*pi, -1, 1, Layer.ColorMappedContour)


s2.setTitle("Color Mapped Contour Plot")

s3 = g.addFunction2D(f, -2*pi, 0, -2*pi, 0, -1, 1, Layer.GrayScale)


s3.setTitle("Gray Scale Plot")

s4 = g.addFunction2D(f, 0, 2*pi, -2*pi, 0, -1, 1, Layer.HeatMap)


s4.setTitle("Heat Map")

7.2.14.21 Histograms

As you have seen in the previous section, it is possible to create 2D histograms from matrices or tables. The script bellow shows
a straightforward way of plotting a histogram from a table column:
h = newGraph().activeLayer().addHistogram(table("Table1"), "Table1_2")
h.setBinCount(5, 1, 30)# the number of bins is set to 5, data range is set to [1, 30]

or from a matrix:
g = plotHistogram(matrix("Matrix1")).activeLayer()
The QtiPlot Handbook 388 / 452

A more complex plot type that displays a histogram together with the corresponding cumulative probabilities can be created:
g1 = plotHistogramProbabilities(table("Table1"), "Table1_2").activeLayer()
g2 = plotHistogramProbabilities(matrix("Matrix1")).activeLayer()

It is also possible to get a reference to a previously created histogram and to modify it according to your needs:
g = graph("Graph1").activeLayer()
h = g.histogram(0)# g is a plot containing one histogram
h.setBinCount(8, 1, 30)
g.replot()

Here’s a small script showing how to customize a histogram and how to get access to the statistical information in the histogram
(bin positions, counts, mean, standard deviation, etc...):
m = newMatrix("TestHistogram", 1000, 800)
m.setFormula("x*y")
m.calculate()

g = newGraph().activeLayer()
h = g.addHistogram(m)
h.setBinSize(10, 1, 90) # the bin size is set to 10, data range is set to [1, 90]

# print histogram values:


for i in range (0, h.dataSize()):
print ’Bin {0}: start = {1}, counts = {2}’.format(i + 1, h.x(i), h.y(i))

# print statistic information:


print "Standard deviation = ", h.standardDeviation()
print "Mean = ", h.mean()
print "Maximum = ", h.maximum()
print "Minimum = ", h.minimum()
print "Number of bins = ", h.binCount()
print "Bin size = ", h.binSize()

You can also enable autobinning (a default number of ten bins will be used):
h.setAutoBinning()

7.2.14.22 Box and whiskers plots

The following script shows how to create and customize a box and whiskers plot:
g = newGraph().activeLayer()
g.plotBox(table("Table1"), ["B", "C", "D"])
for i in range (0, g.numCurves()):
box = g.boxCurve(i)
box.setX(i + 1) # define X coordinate
box.setGap(25) # set gap between boxes in percentages
box.setDataDisplayMode(BoxCurve.BoxRightDataLeft)
box.setDataType(BoxCurve.DotsAndBarsData)
box.setMergeDataBars(True)
box.setSnapDataToBin()
box.setDataAlignment(Qt.AlignRight)
box.setBoxStyle(BoxCurve.Notch)
box.setBoxWidth(80)
box.setWhiskersRange(BoxCurve.MinMax)
box.setCapsLength(0.5)
box.setBrush(QBrush(Qt.red, Qt.BDiagPattern))
s1 = box.percentileSymbol()
s1.setPen(QPen(Qt.blue, 2))
The QtiPlot Handbook 389 / 452

s1.setSize(12)
s1.setBrush(Qt.white)
box.setPercentileSymbol(s1)
s2 = PlotSymbol(PlotSymbol.Diamond, QBrush(Qt.gray), QPen(Qt.black), QSize(6, 6))
box.setSymbol(s2) # symbol for data points
box.setMeanStyle(PlotSymbol.Ellipse)
box.showMeanLine()
box.setMeanLinePen(QPen(Qt.magenta, 2))
box.setLabelsDisplayPolicy(BoxCurve.Value)
g.replot()
box.showMeanLabel()

The following data display modes are available for box plots:

0 BoxCurve.Box
1 BoxCurve.Data
2 BoxCurve.BoxData
3 BoxCurve.BoxRightDataLeft
4 BoxCurve.BoxLeftDataRight

The following data types are available for box plots:

0 BoxCurve.DotsData
1 BoxCurve.BarsData
2 BoxCurve.DotsAndBarsData

The following functions give access to the statistics information for the data series displayed with a box and whiskers plot:
s = box.statistics() # returns information as a string
m = box.median()
q = box.quantile(f) # f must be a fraction between 0 and 1

For an exhaustive review of the methods giving access to the properties of a box plot, please consult the QtiPlot/Python API.

7.2.14.23 Connecting percentile symbols

The following script shows how to connect with lines different percentile symbols within a group of box plots:
g = plot(table("Table1"), ("A","B","C","D","E"), Layer.Box).activeLayer()

bg = g.boxChartGroup()
bg.setDrawLinesOnTop(False)

bg.setConnectMeans(True)
c1 = bg.meanCurve()
c1.setPen(QPen(Qt.red, 2))

bg.setConnectMedians(True)
c2 = bg.medianCurve()
c2.setPen(QPen(Qt.green, 2))

c3 = bg.addPercentileCurve(5)
c3.setPen(QPen(Qt.blue, 2))

c4 = bg.addPercentileCurve(95)
c4.setPen(QPen(Qt.magenta, 2))
The QtiPlot Handbook 390 / 452

7.2.14.24 Distribution Curves

For histograms and box and whiskers plots it is possible to overlay a distribution curve on the binned data. These curves are not
"fitted" to your data. Instead, QtiPlot determines the data mean, then overlays the curve so that means coincide. If it is a two
parameter curve, QtiPlot takes into account the standard deviation of your data. The following distribution types can be used:

0 DataCurve.NoCurve
1 DataCurve.Normal
2 DataCurve.Lognormal
3 DataCurve.Poisson
4 DataCurve.Exponential
5 DataCurve.Laplace
6 DataCurve.Lorentz
7 DataCurve.Weibull
8 DataCurve.KernelSmooth
9 DataCurve.Gamma
10 DataCurve.Binomial

In the case of the Kernel Smooth distribution QtiPlot provides two methods to calculate an optimal bandwidth:

DataCurve.Scott This is the default method. The optimal bandwidth of the Kernel Smooth distribution is calculated using the
formula: w = 0.9*A*N-0.2 , where N is the number of bins, A = min(SD, IQR/1.349), SD is the standard deviation and IQR
is the interquartile range of the bins data set.
DataCurve.Silverman The optimal bandwidth of the Kernel Smooth distribution is: w = 1.059*A*N-0.2 , where N is the number
of bins, A = min(SD, IQR/1.349), SD is the standard deviation and IQR is the interquartile range of the bins data set.

The following script creates a histogram plot over which overlays a KernelSmooth distribution curve with an optimal bandwidth
calculated using the Silverman method. The distribution curve is scaled to 50% of the maximum bin value:
h = newGraph().activeLayer().addHistogram(table("Table1"), "2")
h.setDistributionCurve(DataCurve.KernelSmooth, 50, DataCurve.Silverman)
h.loadData()

The following functions give access to the distribution curve and its properties:
dc = h.distributionCurve()
dc.setPen(Qt.red)
print(h.distributionScaleFactor())
print(h.kernelBandwidth())

When working with box and whiskers plots you can enable the distribution curve in the same way:
g = newGraph().activeLayer()
g.plotBox(table("Table1"), ["B"])
box = g.boxCurve(0)
box.setDataDisplayMode(BoxCurve.BoxData)
box.setSnapDataToBin()
box.setDistributionCurve(DataCurve.KernelSmooth)
box.updateHistogram()
box.distributionCurve().setPen(Qt.blue)
The QtiPlot Handbook 391 / 452

7.2.14.25 Curve Intersections

It is possible to find the intersections between the curves of a 2D plot layer using the intersections() method, which returns a
QPolyonF. The script bellow creates a new plot layer with three analytical functions and prints the coordinates of the intersection
points:
g = newGraph().activeLayer()
g.addFunction("x*sin(x)", 0, 10, 50)
g.addFunction("x/3.0", 1, 10, 2)
g.addFunction("sin(x)", 0, 10, 30)

poly = g.intersections()
for i in range (0, poly.size()):
p = poly[i]
print(p.x(), p.y())

The intersections() method accepts several arguments: the interpolation method used by the search algorithm, the number of
sampling points, the coordinates of the search region. The last argument is a reference to an existing table that is used by QtiPlot
to output the coordinates of the intersection points:
t = newTable()
poly = g.intersections(Interpolation.Linear, 10000, 3.0, 8.0, -0.2, 2.0, t)
if (poly.size() > 0):
c = g.insertCurve(t, t.column(2).fullName(), Layer.Scatter)
c.setSymbol(PlotSymbol(PlotSymbol.XCross, QBrush(), QPen(Qt.blue), QSize(7, 7)))

7.2.14.26 Ridgeline plots

The following script shows how to create a ridgeline plot also displaying a list of quantile lines:
g = plot(table("Book1"), ("A", "B", "C", "D", "E", "F"), Layer.Ridgeline).activeLayer()
for i in range (0, g.numCurves()):
r = g.ridgelineCurve(i)
r.setQuantiles("5 25 75 95")
r.setPen(QPen(Qt.darkGray, 1.5))# set pen for quantile lines
r.setDistributionScaleFactor(120)
r.updateHistogram()

The following display types are available for ridgeline curves:

RidgelineCurve.Distribution This is the default mode: data is shown as a KernelSmooth distribution curve.
RidgelineCurve.DistributionAndData Also draws the data symbols over the distribution curve.
g = plot(table("Book1"), ("A", "B", "C", "D", "E", "F"), Layer.Ridgeline).activeLayer()
for i in range (0, g.numCurves()):
r = g.ridgelineCurve(i)
r.setDisplayMode(RidgelineCurve.DistributionAndData)
r.setSymbol(PlotSymbol(PlotSymbol.Diamond, QBrush(Qt.black), QPen(Qt.black), QSize(4, ←-
4)))

RidgelineCurve.DistributionAndRug Also displays data as a rug beneath the distribution curve. It is possible to customize the
rug pen, the size of the rug (in %) and the gap between the rug and the distribution curve (also in percentages).
g = plot(table("Book1"), ("A", "B", "C", "D", "E", "F"), Layer.Ridgeline).activeLayer()
for i in range (0, g.numCurves()):
r = g.ridgelineCurve(i)
r.setDisplayMode(RidgelineCurve.DistributionAndRug)
r.setRugSize(15)
The QtiPlot Handbook 392 / 452

r.setRugPen(QPen(r.distributionCurve().fillAreaColor(), 1.5))
r.setSpacing(2)
r.setDistributionScaleFactor(80)
r.updateHistogram()

RidgelineCurve.SingleBlockBars Displays the data under the form of a histogram.


g = plot(table("Book1"), ("A", "B", "C", "D", "E", "F"), Layer.Ridgeline).activeLayer()
for i in range (0, g.numCurves()):
r = g.ridgelineCurve(i)
r.setDisplayMode(RidgelineCurve.SingleBlockBars)
r.setBinWidth(80)

7.2.14.27 Pie Plots

The following script shows how to create and customize a 3D pie plot:
g = newGraph().activeLayer()
pie = g.plotPie(table("Table1"), "2")
pie.setRadius(70)
pie.setViewAngle(40)
pie.setThickness(20)
pie.setStartAzimuth(45)
pie.setLabelsEdgeDistance(50)
pie.setCounterClockwise(True)
pie.setBrushStyle(Qt.Dense3Pattern)
pie.setIncrementPattern(True)
pie.setFirstColor(3)
pie.setPen(QtGui.QPen(Qt.red, 2))
pie.setLabelValuesFormat(True)

Here’s how you can create a 2D black and white pie chart:
pie2D = newGraph().activeLayer().plotPie(table("Table1"), "2")
pie2D.setViewAngle(90.0);
pie2D.setFirstColor(-1);
pie2D.setIncrementPattern();

For an exhaustive review of the methods giving access to the properties of a pie plot, please consult the QtiPlot/Python API.

7.2.14.28 Doughnut Plots

The following script shows how to quickly create a doughnut plot from a single data set:
doughnut = newGraph().activeLayer().plotPie(table("Table1"), "Table1_A")
doughnut.setViewAngle(90.0)
doughnut.setHoleSize(50)

The script bellow demonstrates how to create multiple doughnut plots from several data sets. The first parameter of the set-
DoughnutLayout function is the radius of the largest doughnut chart expressed as a percentage of the plot width. Its default value
is set to 90%. The second parameter is the size of the doughnut hole. By default it is set to 50% of the radius for each doughnut
plot.
t = table("Table1")
g = newGraph().activeLayer()
g.plotPie(t, "Table1_A")
g.plotPie(t, "Table1_B")
g.plotPie(t, "Table1_C")
g.setDoughnutLayout(80, 40)
The QtiPlot Handbook 393 / 452

7.2.14.29 Vector Plots

You can create a vector plot by giving four columns in a Python tuple as an argument and the plot type as Layer.VectXYXY
(11) or Layer.VectXYAM (14), depending on how you want to define the end point of your vectors: using (X, Y) coordinates or
(Angle, Magnitude) coordinates.
g = qti.app.plot(table("Table1"), (2,3,4,5), Layer.VectXYXY)

In the case of XYAM vector plots you can set a constant angle and/or magnitude, but you still need to specify at least two column
names in order to define the origin of the vectors. The following script shows how to create and customize XYAM vector curves:
g = newGraph().activeLayer()
t = table("Table1")

v = g.plotVectors(t, ["Table1_1", "Table1_2"], Layer.VectXYAM)


v.setConstantAngle(135)
v.setConstantMagnitude(15)
v.setPosition(VectorCurve.Head)

v = g.plotVectors(t, ["Table1_1", "Table1_2", "Table1_3"], Layer.VectXYAM)


v.setConstantMagnitude(10)
v.setMagnitudeInPixels()
v.setVectorPen(Qt.red)

v = g.plotVectors(t, ["Table1_1", "Table1_2", "", "Table1_3"], Layer.VectXYAM)


v.setConstantAngle(90)
v.setVectorPen(Qt.blue)

v = g.plotVectors(t, ["Table1_1", "Table1_2", "Table1_3", "Table1_4"], Layer.VectXYAM)


v.setVectorPen(Qt.green)
v.fillArrowHead(False)
v.setHeadAngle(15)
v.setHeadLength(20)
v.setMagnitudeMultiplier(10)
v.setPosition(VectorCurve.Middle)

By default the magnitudes are interpreted in real world coordinates and are used to compute the x, y values of the end point of
the vector. The magnitudes displayed in the graph will change when the X or Y axes scales are changed, but they will remain
constant in real world coordinates. By using the method setMagnitudeInPixels with the default True argument, the
magnitudes will be calculated in pixels and will remain constant when the X or Y axes scales are changed. The same effect can
be obtained by using the setRealWorldMagnitude(False) method.
For an exhaustive review of the methods giving access to the properties of a vector curve, please consult the QtiPlot/Python API.

7.2.14.30 Adding arrows/lines to a plot layer

arrow = ArrowMarker()
arrow.setStart(210.5, 212.5)
arrow.setEnd(400, 400.51)

#customize line
arrow.setStyle(QtCore.Qt.DashLine)
arrow.setColor(Qt.red)
arrow.setWidth(1)

#customize start arrow head


arrow.setStartArrowShape(Layer.VerticalLine)
arrow.setStartHeadLength(15)
arrow.setStartHeadAngle(25)
The QtiPlot Handbook 394 / 452

#customize end arrow head


arrow.setEndArrowShape(Layer.FilledAngle)
arrow.setEndHeadLength(20)
arrow.setEndHeadAngle(15)

l = newGraph().activeLayer()
arrow1 = l.addArrow(arrow)

arrow.setStart(120.5, 320.5)
arrow.setColor(Qt.blue)
arrow2 = l.addArrow(arrow)

l.remove(arrow1)

As you might notice from the sample code above, the addArrow function returns a reference to a new arrow object that can be
used later on to modify this new arrow or to delete it with the remove function.
The shape of an arrow head can take one of the following values:

0. Layer.NoArrow
1. Layer.FilledTriangle

2. Layer.Angle
3. Layer.FilledAngle
4. Layer.EmptyTriangle

5. Layer.Diamond
6. Layer.VerticalLine
7. Layer.HalfLineDown
8. Layer.HalfLineUp

9. Layer.XCross
10. Layer.Rectangle
11. Layer.Ellipse

The end points of a line/arrow can be retrieved like shown bellow:


a = newGraph().activeLayer().addArrow(ArrowMarker())
a.setEnd(200.5, 400.5)

start = a.startPointCoord() # start point in scale coordinates


end = a.endPointCoord() # end point in scale coordinates

print(start.x(), start.y())
print(end.x(), end.y())

start = a.startPoint() # start point in pixels


end = a.endPoint() # end point in pixels

print(start.x(), start.y())
print(end.x(), end.y())

It is possible to modify the properties of all the lines/arrows in a plot layer, see the short example below:
The QtiPlot Handbook 395 / 452

l = graph("Graph1").activeLayer()
for arrow in l.arrowsList():
arrow.setColor(Qt.green)
l.replot()

The number of lines/arrows in a plot layer can be retrieved using the function numArrows:
l = graph("Graph1").activeLayer()
print l.numArrows()

It is possible to get a reference to the selected line/arrow in a plot layer using the function selectedArrow:
a = graph("Graph1").activeLayer().selectedArrow()

Starting with version 0.9.9.3 the functions bellow are deprecated. These methods are still provided in order to keep old source
code working but they are no longer maintained. We strongly advise against using them in new code.
drawStartArrow(bool)
drawEndArrow(bool)
fillArrowHead(bool)
setHeadLength(int)
setHeadAngle(int)

7.2.14.31 Reference lines

The sample script bellow shows how to add a horizontal reference line at a constant axis value in a newly created plot layer and
how to customize it’s main properties like: line pen, fill brush, baseline value and linked label.
g = newGraph().activeLayer()

hline = g.addReferenceLine(600.0)
hline.setLinePen(QPen(Qt.red, 1.5, Qt.DashLine))
hline.setFillBrush(QColor(255, 0, 0, 50))
hline.setBaseline(200.0)

label = g.legend()
label.setText("$(v, *5)")

hline.setLegend(label)
hline.setLabelAlignment(Qt.AlignBottom)

g.replot()
hline.updateLegendPosition()

It is possible to add a reference line that is attached to an existing plot curve and is displayed at a predefined statistical value:
g = newGraph().activeLayer()
g.addFunction("sin(x)", 0, 10, 100)

vline = g.addReferenceLine(g.curve(0), LineMarker.Maximum)


vline.setLinePen(QPen(Qt.red, 1.5))
vline.setFillBrush(QColor(255, 0, 0, 50))
vline.setBaseline(-1.0)
vline.setLabelAlignment(Qt.AlignBottom)

l = vline.newLegend()
l.setFrameStyle(0)
l.setTextColor(Qt.red)
l.setBackgroundColor(QColor(255, 255, 255, 0))
The QtiPlot Handbook 396 / 452

The predefined statistical types are:

LineMarker.Mean Mean value of the curve data points.


LineMarker.Median Median value of the curve data points.
LineMarker.MeanPlusSD Mean value plus the standard deviation of the curve data points.
LineMarker.MeanMinusSD Mean value minus the standard deviation of the curve data points.
LineMarker.MeanPlusSE Mean value plus the standard error of the curve data points.
LineMarker.MeanMinusSE Mean value minus the standard error of the curve data points.
LineMarker.MeanPlus95CI The upper limit of the 95% confidence interval for the mean of the curve data points.
LineMarker.MeanMinus95CI The lower limit of the 95% confidence interval for the mean of the curve data points.
LineMarker.Minimum Minimum value of the curve data points.
LineMarker.Maximum Maximum value of the curve data points.

A reference line may serve as baseline for another one. Of course, the two reference lines should have the same orientation
(horizontal or vertical):
g = newGraph().activeLayer()

vline1 = g.addReferenceLine(400.0, Qt.Vertical)


vline1.setLinePen(QPen(Qt.blue, 1))

vline2 = g.addReferenceLine(600.0, Qt.Vertical)


vline2.setLinePen(vline1.linePen())
vline2.setFillBrush(QColor(0, 0, 255, 50))
vline2.setBase(vline1)

Furthermore, it is possible to draw only the color filling between two reference lines creating thus a plot region:
g = newGraph().activeLayer()

vline1 = g.addReferenceLine(400.0, Qt.Vertical)


vline1.setDrawLine(False)

vline2 = g.addReferenceLine(600.0, Qt.Vertical)


vline2.setFillBrush(QColor(0, 0, 255, 50))
vline2.setDrawLine(False)
vline2.setBase(vline1)

A reference line has a non-empty default name. The default generated names are: line1, line2, etc... It is possible, of course,
to change the default name as shown bellow:
g = newGraph().activeLayer()
line = g.addReferenceLine(400.0)
line.setName("MyLine")
print(line.name())

The name of a line, as well as its index, can be used in order to get a pointer to it. The indices start at zero:
l = g.referenceLine("MyLine")
#l = g.referenceLine(0)
if not l:
print("No line!")
else:
l.setPosition(500)
The QtiPlot Handbook 397 / 452

A reference line can be removed from a graph like shown in the script bellow:
g.remove(g.referenceLine(0))

7.2.14.32 Adding images to a layer

l = newGraph().activeLayer()
image = l.addImage("C:/poze/adi/PIC00074.jpg")
image.setCoordinates(200, 800, 800, 200)
image.setFrameStyle(Frame.Shadow)
image.setFrameColor(QtCore.Qt.green)
image.setFrameWidth(3)
l.replot()

The setCoordinates function above can be used to set the geometry of the image using scale coordinates. If you need to
specify the image geometry in pixel coordinates, independently of the plot axes values, you may use the following functions:
image.setOrigin(x, y)
image.setSize(width, height)
image.setRect(x, y, width, height)
l.replot()

You can remove an image using its reference:


l.remove(image)

7.2.14.33 Rectangles

l = newGraph().activeLayer()

r = Rectangle(l)
r.setSize(100, 100)
r.setOrigin(100, 200)
r.setBackgroundColor(QtCore.Qt.yellow)
r.setFrameColor(QtCore.Qt.red)
r.setFrameWidth(3)
r.setFrameLineStyle(QtCore.Qt.DotLine)
r.setBrush(QtGui.QBrush(QtCore.Qt.green, QtCore.Qt.FDiagPattern))

r1 = l.add(r)

You can remove a rectangle using its reference:


r2 = l.add(r)
r2.setOrigin(200, 200)
l.remove(r1)

7.2.14.34 Circles/Ellipses

l = newGraph().activeLayer()

e = Ellipse(l)
e.setSize(100, 100)
e.setOrigin(100, 200)
e.setBackgroundColor(QtCore.Qt.yellow)
e.setFrameColor(QtCore.Qt.red)
The QtiPlot Handbook 398 / 452

e.setFrameWidth(0.8)
e.setFrameLineStyle(QtCore.Qt.DotLine)
e.setBrush(QtGui.QBrush(QtCore.Qt.green, QtCore.Qt.FDiagPattern))

l.add(e)

7.2.14.35 Plot Tables

Plot tables are special 2D plot objects that can be used for presentation of data. They have nothing in common with the table
windows used as data sources for the plot curves. You can add a plot table to a multilayer graph window and customise it like
shown in the example bellow:
cols = 4
rows = 3
l = newGraph().activeLayer()
t = l.add(PlotTable(l, rows, cols))
t.resize(250, 120)
t.setGridColor(Qt.blue)
t.setGridStyle(Qt.DashLine)

tw = t.tableWidget()# tw is a QTableWidget
# customise the table header
for j in range (0, cols):
cell = tw.item(0, j)# cell is a QTableWidgetItem
cell.setText("Header")
cell.setFont(QFont("Arial", 14, QFont.Bold, True))
cell.setForeground(Qt.darkRed)
cell.setBackground(Qt.gray)
# customise table cells
for i in range (1, rows):
for j in range (0, cols):
cell = tw.item(i, j)
cell.setText("cell")
cell.setForeground(Qt.darkGreen)
cell.setBackground(Qt.lightGray)

The alignment of the text in the table cells, the color of the text, the font and the background color can also be customised using
the methods bellow:
t = newGraph().activeLayer().addTable()
t.setTextAlignment(Qt.AlignRight | Qt.AlignVCenter)
t.setTextColor(Qt.blue)
t.setTextFont(QFont("Courier", 12, QFont.Bold, False))
t.setBackground(Qt.lightGray)

The dimensions of an existing plot table can be modified using the following functions:
t = newGraph().activeLayer().addTable()
t.setNumRows(5)
t.setNumCols(6)
t.resize(250, 120)

The grid of a plot table can only be customised in terms of color and pen style:
t = newGraph().activeLayer().addTable()
t.setGridColor(Qt.red)
t.setGridStyle(Qt.DotLine)

By default the columns of a plot table have equally sized columns. It is possible to change this default behaviour to a different
functioning mode where all columns automatically resize to the dimensions of their content except for the last column which will
always stretch to occupy the remaining space, by using the setStretchModeEnabled function:
The QtiPlot Handbook 399 / 452

t = newGraph().activeLayer().addTable()
t.setStretchModeEnabled(False)

tw = t.tableWidget()# tw is a QTableWidget
for i in range (0, tw.rowCount()):
for j in range (0, tw.columnCount()):
cell = tw.item(i, j)
cell.setText("cell")

7.2.14.36 Color Scale Legends

You can add a color scale legend like in the example bellow:
cs = graph("Graph1").activeLayer().addColorScaleLegend()
cs.setOrigin(500, 20)
cs.setSize(100, 200)

By default a new color scale is attached to the first plot curve/matrix available in the plot layer, meaning that the color map
displayed by the legend is the color map of this plot item. It is possible to change the plot item to which the color scale is
attached using the index of the item (starting at zero), like shown bellow:
cs = graph("Graph1").activeLayer().addColorScaleLegend()
cs.setPlotItem(1)
cs.setOrigin(500, 20)

Please note that if the index argument of the setPlotItem function has a negative value (no plot item attached), than the color
scale legend displays a default color map, that can be customized via the setDefaultColorMap function:
map = LinearColorMap(Qt.yellow, Qt.blue)
map.addColorStop(0.2, Qt.magenta)
map.addColorStop(0.5, Qt.red)
map.addColorStop(0.7, Qt.cyan)

cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setPlotItem(-1)
cs.setDefaultColorMap(map)

The colorScaleList() function provides a list containing the references of all color scale legends available in a plot layer.
You can use it in order to get a reference to an already existing color scale legend and to customize it according to your needs.
You can change for example its default layout, like shown in the script bellow:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setColorBarWidth(30)
# Align the tick labels to the left and vertically centered
cs.setLabelAlignment(Qt.AlignLeft | Qt.AlignVCenter)
cs.setAlignment(2) # left scale layout
# Set the distance between the legend frame and the color bar ends to 15 pixels
cs.setBorderDist(15)
# Set the distance between the ticks and the tick labels to 10 pixels
cs.setLabelSpace(10)
cs.setInvertedScale(True)

The alignment of a color scale legend can take one of the following values:

0. Bottom scale
1. Top scale
2. Left scale
The QtiPlot Handbook 400 / 452

3. Right scale. This is the default layout.

By default the color bar of the legend has a black frame. It is possible to remove it:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setDrawColorBarFrame(False)
cs.repaint()

or to customize its appearance:


cs = graph("Graph1").activeLayer().colorScaleList()[0]
# reenable the drawing of the color bar frame
cs.setDrawColorBarFrame()
# modify the color and line width of the frame
cs.setColorBarFramePen(QPen(Qt.blue, 2.5))
cs.repaint()

The main line ("backbone") of the axis of a color scale legend is hidden by default (the getter function hasBackbone() returns
False). It is possible to enable it and customize its appearance, using the functions bellow:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.enableBackbone(True)
cs.setAxisColor(Qt.blue)
cs.setAxisLineWidth(1)
# Set the distance between the axis and the color bar to 2 pixels
cs.setAxisMargin(2)

By default the title of a color scale legend (returned by the function axisTitle()) is an empty string, but it is possible to
define a custom title:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setAxisTitle("My color scale lagend!")
cs.setAxisTitleColor(Qt.blue)
cs.setAxisTitleFont(QFont("Courier", 12))
cs.setAxisTitleAlignment(Qt.AlignRight)

The layout of the major tick labels can be completely customized using the following functions:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLabelAlignment(Qt.AlignHCenter| Qt.AlignVCenter)
# Set the distance between the ticks and the tick labels to 12 pixels
cs.setLabelSpace(12)
cs.setLabelRotation(-45)
cs.repaint()# makes the changes visible

The font and color of the major tick labels can be also customized using the following functions:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLabelFont(QFont("Courier", 12))
cs.setLabelColor(Qt.red)

The numerical format of the labels can be set using the function setLabelsNumericFormat(format, precision),
where format can have the following values:

0. Automatic: the most compact numeric representation is chosen.


1. Decimal: numbers are displayed in floating point form.

2. Scientific lower case exponential notation, e.g.: 1.0e+04.


3. Superscripts: like Scientific, but the exponential part is displayed as a power of 10.
The QtiPlot Handbook 401 / 452

4. Engineering format, e.g: 10k.


5. Superscripts: like Superscripts above, but the multiplication sign is replaced by a dot sign.
6. Scientific upper case exponential notation, e.g.: 1.0E+04.

and precision is the number of significant digits (the default value is 6):
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLabelsNumericFormat(3, 1)
cs.updateScale()

Additionally it is possible to define a prefix and/or a suffix for the major tick labels using the functions bellow:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLabelPrefix("Value: ")
cs.setLabelSuffix(" mm")
cs.repaint()

Finally it is possible to disable the display of the major tick labels using the function enableLables():
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.enableLables(False)

The default policy for color scale legends is to display a major tick for each level in the color map. This can be changed using
the setLevelsDisplayMode function. Its argument can take one of the following values:

0 or ColorScale.AllMajorLevels: A major tick is displayed for each level in the color map.
1 or ColorScale.PartialTotalLevels: A major tick is displayed for every n-th color level, where n can be defined using the
setSkipMajorTicksCount function.
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLevelsDisplayMode(ColorScale.PartialTotalLevels)
cs.setSkipMajorTicksCount(1)
cs.updateScale()

2 or ColorScale.CustomStepLevels: A major tick is displayed at regular intervals starting with the lowest color level in the
map. The step can be defined using the setAxisStep function.
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLevelsDisplayMode(ColorScale.CustomStepLevels)
cs.setAxisStep(4.5)
cs.updateScale()

3 or ColorScale.CustomCountLevels: The total number of major tick can be defined using the setMajorTicksCount
function.
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setLevelsDisplayMode(ColorScale.CustomCountLevels)
cs.setMajorTicksCount(10)
cs.updateScale()

By default a color scale legend has no minor ticks (the getter function minorTicksCount returns zero), but it is possible to
modify their number using the function setMinorTicksCount:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setMinorTicksCount(4)
cs.updateScale()
The QtiPlot Handbook 402 / 452

The length of the ticks (both minor and major) can be customized using the function setTicksLength:
cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.setTicksLength(5, 10) # minor ticks have 5 pixels, major ticks 10

Finally, it is possible to disable the display of the ticks:


cs = graph("Graph1").activeLayer().colorScaleList()[0]
cs.enableTicks(False)

7.2.14.37 Exporting graphs

Layers and whole graph windows can be printed and exported from within Python. The fastest way to export a graph window or
single layers is the following:
l.export(fileName)

This function uses some default parameters for the properties of the image. If you need more control over the exported images
you can use one of the following specialized functions:
l.exportVector(fileName, size = QtCore.QSizeF(), unit = Frame.Pixel, fontsFactor = 1.0, ←-
color = True)
l.exportImage(fileName, quality = 100, transparent = False, dpi = 0, size = QtCore.QSizeF() ←-
, unit = Frame.Pixel, fontsFactor = 1.0, compression = 0)
l.exportTex(fileName, color = True, escapeStrings = True, fontSizes = True, size = QtCore. ←-
QSizeF(), unit = Frame.Pixel, fontsFactor = 1.0)

When exporting graph windows there is an extra boolean parameter that can be used in order to clip the space around plot layers.
This last parameter has no effect if used in conjunction with a custom export size. An example of how you should call these
functions can be found bellow:
g = graph("Graph1")
g.exportVector("test.pdf", QtCore.QSizeF(), Frame.Pixel, 1.0, True, True)
g.exportImage("test.png", 100, True, 0, QtCore.QSizeF(), Frame.Pixel, 1.0, 0, True)
g.exportTex("test.tex", True, True, True, QtCore.QSizeF(), Frame.Pixel, 1.0, True)

The function exportVector can export the plot/layer to the following vector formats: .eps, .emf, .ps, .pdf, .svg and .wmf (this
last format is only supported on Windows platforms). The use of the color parameter only makes sense when exporting to .eps,
.pdf and .ps formats. For all other formats it is ignored.
The function exportImage can be used if you need to export to one of the Qt supported raster image formats (.bmp, .png,
.jpg, etc...). The transparent option can only be used in conjunction with the file formats supporting transprency: .png and
.tif (.tiff). The quality parameter influences the size of the output file. The higher this value (maximum is 100), the higher the
quality of the image, but the larger the size of the resulting files. The dpi parameter represents the export resolution in pixels
per inch (the default is screen resolution), size is the printed size of the image (the default is the size on screen) and unit is
the length unit used to express the custom size and can take one of the following values:

0. Inch
1. Millimeter

2. Centimeter
3. Point: 1/72th of an inch
4. Pixel
The QtiPlot Handbook 403 / 452

The fontsFactor parameter represents a scaling factor for the font sizes of all texts in the plot (the default is 1.0, meaning no
scaling). If you set this parameter to 0, the program will automatically try to calculate a scale factor.
The compression parameter can be 0 (no compression) or 1 (LZW) and is only effectif for .tif/.tiff images. It is neglected for
all other raster image formats.
It is also possible to get a QPixmap from a 2D plot layer that can be used later on for saving to a raster format image, like shown
bellow:
g = graph("Graph1").activeLayer()

pix1 = g.pixmap()
pix1.save("/Users/ion/Desktop/Graph1.png")

pix2 = g.pixmap(QSize(1000, 800)) # custom image size in pixels


pix2.save("/Users/ion/Desktop/Graph2.png")

pix3 = g.pixmap(QSize(1000, 800), 1.5) # 1.5 scaling fonts factor


pix3.save("/Users/ion/Desktop/Graph3.png")

pix4 = g.pixmap(QSize(1000, 800), 1.5, True) # enable transparency


pix4.save("/Users/ion/Desktop/Graph4.png")

pix5 = g.pixmap(QSize(1000, 800), 0.0, False, 0.0) # automatic scaling factors


pix5.save("/Users/ion/Desktop/Graph5.png")

The function exportTex can be used if you need to export to a TeX file. The escapeStrings parameter enables/disables
the escaping of special TeX characters like: $, {, }, ˆ, etc... If True, the fontSizes parameter triggers the export of the
original font sizes in the plot layer. Otherwise all exported text strings will use the font size specified in the preamble of the TeX
document.
All the export functions rely on the file name suffix in order to choose the image format.

7.2.14.38 Arranging Layers

When you are working with many layers in a 2D plot window, setting the layout of these layers manually can be a very tedious
task. With the help of a simple Python script you can make this task very easy and automatically manage the layout of the plot
window. For example, here’s how you can create a two rows by two columns matrix of layers, each plot layer having a canvas
size (the drawing area) of 400 pixels wide and 300 pixels in height:
g = newGraph("Test", 4, 2, 2)
g.setLayerCanvasSize(400, 300)
g.arrangeLayers(False, True)

The arrangeLayers() function takes two parameters. The first one specifies if the layers should be arranged automatically,
using a best-layout algorithm, or if the numbers of rows and columns is fixed by the user. If the value of the second parameter is
True, the size of the canvas is fixed by the user and the plot window will be enlarged or shrunken, according to the user settings.
Otherwise the size of the plot window will be kept and the canvas area of each layer will be automatically adapted to fit this size.
Here’s how you can modify the graph created in the previous example, in order to display a row of three layers, while keeping
the size of the plot window unchanged:
g.setNumLayers(3)
g.setRows(1)
g.setCols(3)
g.arrangeLayers(False, False)

By default, the space between two neighboring layers as well as the distance between the layers and the borders of the plot
window is set to five pixels. You can change the spacing between the layers and the margins using the following functions:
g.setSpacing(x, y)
g.setMargins(left, right, top, bottom)
The QtiPlot Handbook 404 / 452

Another aspect of the layout management is the alignment of the layers. There are three alignment flags that you can use for the
horizontal alignment (HCenter, Left, Right) and another three for the vertical alignment (VCenter, Top, Bottom) of the layers.
The following code line aligns the layers with the right edge of the window and centers them vertically in the available space:
g.setAlignment(Graph.Right, Graph.VCenter)

The alignment of the layers can be done with respect to the drawing area between the axes (Graph.AlignCanvases) or with respect
to the whole layer widget (Graph.AlignLayers) and you can specify the alignment policy to use via the following method:
g.setAlignPolicy(Graph.AlignCanvases)

A very often needed layout is the one with shared layer axes having linked abscissae (modifying the x scale for one layer will
automatically adjust the scales for all plot layers). Here’s how you can simply create such a 2x2 layers grid, with only a few lines
of code:
g = newGraph("", 4, 2, 2)
g.setSpacing(0, 0)
g.setAlignPolicy(Graph.AlignCanvases)
g.setCommonLayerAxes()
g.arrangeLayers()
g.linkXLayerAxes(True)

All the examples above suppose that the layers are arranged on a grid, but of course you can add layers at any position in the plot
window. In the examples below the x, y coordinates, in pixels, refer to the position of the top-left corner of the layer. The origin
of the coordinates system coincides with the top-left corner of the plot window, the y coordinate increasing towards the bottom
of the window. If the width and height of the layer are not specified they will be set to the default values. The last argument
specifies if the default preferences, specified via the Preferences dialog, will be used to customize the new layer (default value is
False):
g = newGraph()
l1 = g.addLayer()
l2 = g.addLayer(215, 20)
l3 = g.addLayer(10, 20, 200, 200)
l4 = g.addLayer(10, 20, 200, 200, True)

You can remove a plot layer using:


l = g.layer(num)
g.removeLayer(l)
g.removeActiveLayer()

As you have already seen, in a plot window the active layer is, by default, the last layer added to the plot, but you can change it
programatically:
l = g.layer(num)
g.setActiveLayer(l)

In case you need to perform a repetitive task on all the layers in a plot window, you need to use a for loop and of course you need
to know the number of layers existing on the plot. Here’s a small example showing how to custom the titles of all the layers in
the plot window:
g = graph("Graph1")
layers = g.numLayers()
for i in range (1, layers+1):
l = g.layer(i)
l.setTitle("Layer"+QtCore.QString.number(i))
l.setTitleColor(QtGui.QColor("red"))
l.setTitleFont(QtGui.QFont("Arial", 14, QtGui.QFont.Bold, True))
l.setTitleAlignment(QtCore.Qt.AlignLeft)

Finally, sometimes it might be useful to be able to swap two layers. This can be done with the help of the following function:
g.swapLayers(layerNum1, layerNum2)
The QtiPlot Handbook 405 / 452

7.2.14.39 Waterfall Plots

Waterfall plots are ideal for comparing variations between multiple data sets created under similar conditions. A pseudo 3D
effect is generated by applying an offset to all the data curves in a 2D plot layer, enabling you to see variations in the Z direction.
You can create and customize them using the functions below:
g = waterfallPlot(table("Table1"), (2, 3, 4))
l = g.activeLayer()
l.setWaterfallOffset(50, 20)# x/y offsets as % of the layer drawing area width/height
l.setWaterfallSideLines(True) # draw side lines for all the data curves
l.setWaterfallFillColor(Qt.lightGray)
g.reverseWaterfallOrder() # reverse the order of the displayed curves

7.2.15 3D Plots

7.2.15.1 Creating a 3D plot

You can plot 3D analytical functions or parametric surfaces. For the 3D functions, the only parameters allowed are x for the the
abscissae values and y for the ordinates:
g = plot3D("sin(x*y)", -10.0, 10.0, -10.0, 10.0, -2.0, 2.0)

For the parametric surfaces the only parameters allowed are the latitude and the longitude: u and v. Here’s, for example, how
you can plot a sphere:
g = plot3D("sin(u)*cos(v)", "sin(u)*sin(v)", "cos(u)", 0, 2*pi, 0, pi)

You can also create 3D height maps using data from matrices and, of course, you can plot table columns:
g = plot3D(matrix("Matrix1"), style = 5)
g = plot3D(table("Table1"), "3", style)

In the case of 3D plots created from matrix data sources the style parameter can take any integer value from 0 to 5, with the
following signification:

Qti3D.NOPLOT (0) No visible data


Qti3D.WIREFRAME (1) Wireframe style
Qti3D.HIDDENLINE (2) Hidden Line style.
Qti3D.FILLED (3) Color filled polygons without edges (no visible mesh).
Qti3D.FILLEDMESH (4) Color filled polygons with separately colored edges (visible mesh).
Qti3D.POINTS (5) Scattered points (the default style)

For 3D plots created from tables the style parameter can take any integer value from 0 to 9 or the equivalent style values from
the following list:

0. Graph3D.Scatter
1. Graph3D.Trajectory
2. Graph3D.Bars
3. Graph3D.Ribbon (only usable for XYY plots)
4. Graph3D.LineSymbols
The QtiPlot Handbook 406 / 452

5. Graph3D.StackBar
6. Graph3D.StackBarPercent
7. Graph3D.InlineBars
8. Graph3D.StackArea
9. Graph3D.StackAreaPercent
10. Graph3D.Area (only usable for XYY plots)
11. Graph3D.Wall (only usable for XYY plots)
12. Graph3D.StackWall (only usable for XYY plots)
13. Graph3D.StackWallPercent (only usable for XYY plots)

7.2.15.2 Customizing the view

When a new 3D plot is created, the scene view parameters are set to default values. Of course, QtiPlot provides functions to
customize each aspect of the view. For example, you can set rotation angles, in degrees, around the X, Y and Z axes, respectively,
using:
g.setRotation(45, 15, 35)

The following function allows you to shift the plot along the world X, Y and Z axes, respectively:
g.setShift(3.0, 7.0, -4.0)

You can also zoom in/out the entire plot as a whole, or you can zoom along a particular axis:
g.setZoom(10)
g.setScale(0.1, 0.05, 0.3)

Also, you can automatically detect the zoom values that fit best with the size of the plot window:
g.findBestLayout()

Once a plot is created, you can modify the scales and set the data range to display, using, for example:
g.setScales(-1.0, 1.0, -10.0, 11.0, -2.0, 3.0)
g.setAxisScale(Qti3D.X1, 0, 11) # set scale for X axis
g.setAxisScale(Qti3D.Y1, 0.0, 1.5, 0.5, 4, 0) # set scale limits, step and ticks for Y axis

It is possible to set a custom background color:


g.setBackgroundColor(QColor("lightYellow"))

Finally, it is possible to animate the view. The rotation angles around the three axes at each step of the animation can be
customized like shown in the example bellow:
g.setAnimationSteps(0, 0, 1)
g.animate(True)

It is possible to copy a source plot window gSrc to a destination 3D plot gDst, like in the example bellow:
gSrc = plot3D("Graph1")
gDst = newPlot3D("testClone3D")
gDst.copy(gSrc)

Please note that it is also possible to copy only the format of a 3D plot window without affecting the data source of its curves:
gSrc = plot3D("Graph1")
gDst = plot3D("Graph2")
gDst.copy(gSrc, False) # copy only the format of the curves, not the data
The QtiPlot Handbook 407 / 452

7.2.15.3 Adding curves

An alternative method to create a 3D plot is to create an empty plot window and to fill it with curves/surfaces from various data
sources. As you have already seen, a data source can be an analytical function or a parametric surface, a matrix or a table.
g = newPlot3D("test3D")
g.setTitle("My 3D Plot", Qt.blue, QFont("Arial",14))

c1 = g.addMatrix(matrix("Matrix1"))
c1.setMeshColor(Qt.gray)

c2 = g.addFunction("sin(x*y)", -2.0, 2.0, -2.0, 2.0, -1.0, 1.0)


c2.setMeshColor(Qt.black)

c3 = g.addParametricSurface("sin(u)*cos(v)", "sin(u)*sin(v)", "cos(u)", 0, 2*pi, 0, pi)


c3.setMeshColor(Qt.blue)
c3.setDataColors(Qt.cyan)

It is allowed to add two or more 3D surfaces to the same plot window using a single data source matrix. In order to visualise
them as distinct surfaces, one can enable a shift along the Z axis for each of them. The shift value is expressed as a percentage
of the Z axis range. A zero value for the shift means that the minimum value of the surface is displayed at the minimum/bottom
value of the Z scale. A value of 1 for the shift means that the minimum value of the surface is displayed at the maximum/top
value of the Z scale.
m = matrix("Matrix1")
g = newPlot3D()

c1 = g.addMatrix(m)
c1.setPlotStyle(Qti3D.HIDDENLINE)
c1.setMeshColor(Qt.blue)
c1.enableZShift(True)
c1.setZShift(0.0)

c2 = g.addMatrix(m)
c2.setPlotStyle(Qti3D.FILLED)
c2.enableZShift(True)
c2.setZShift(0.5)

g.setAxisScale(Qti3D.Z1, -150.0, 150.0, 50.0)


g.findBestLayout()

It is possible to add several curves at once to the same 3D plot, provided that the data sets belong to the same table:
t = table("Table1")
newPlot3D().plotXYY(t, ("C", "D", "E", "F"), Graph3D.Bars)
newPlot3D().plotXYY(t, ("C", "D", "E", "F"), Graph3D.InlineBars)
newPlot3D().plotXYZ(t, ("C", "D", "E", "F"), Graph3D.StackBar)
newPlot3D().plotXYZ(t, ("C", "D", "E", "F"), Graph3D.StackArea)
newPlot3D().plotXYY(t, ("C", "D", "E", "F"), Graph3D.Wall)
newPlot3D().plotXYY(t, ("C", "D", "E", "F"), Graph3D.StackWallPercent)

It is also possible to add data sets from different source tables to the same 3D plot. In the script bellow "A", "B" and "C" are the
names of the X, Y and Z columns used to define the XYZ curves. The script adds two XYZ curves to a new 3D plot window and
customises their appearance:
g = newPlot3D()

c1 = g.addData(table("Table1"), "A", "B", "C", Graph3D.LineSymbols)


c1.setDataColors(Qt.red)
c1.setMeshColor(Qt.red)
c1.setMeshLineWidth(1.5)
The QtiPlot Handbook 408 / 452

c2 = g.addData(table("Table2"), "A", "B", "D", Graph3D.LineSymbols)


c2.setDataColors(Qt.green)
c2.setMeshColor(Qt.green)
c2.setMeshLineWidth(1.5)

g.setScales(0, 11, 0, 11, 0, 1, False)

The script bellow adds two XYY bar curves to a new 3D plot window. For each curve you need to specify two column names for
the X and Y values and an extra Y coordinate. If the table does not contain a X column, simply enter an empty string for the X
column name. In this case QtiPlot uses the row indices as X coordinates.
g = newPlot3D()

c1 = g.addData(table("Table1"), "A", "C", 0.5, Graph3D.Bars)


c1.setDataColors(Qt.red)
c1.setMeshColor(Qt.white)
c1.setMeshLineWidth(1.0)

c2 = g.addData(table("Table2"), "", "D", 1.0, Graph3D.Bars) # no X column


c2.setDataColors(Qt.green)
c2.setMeshColor(Qt.white)
c2.setMeshLineWidth(1.0)

g.setAxisScale(Qti3D.X1, 0, 11) # set scale for X axis


g.setAxisScale(Qti3D.Y1, 0.0, 1.5, 0.0, 2, 0) # set scale and ticks for Y axis
g.findBestLayout()

The example bellow adds two ribbon curves to a newly created plot and customises their appearance:
g = newPlot3D()

c1 = g.addData(table("Table1"), "A", "B", 0.0, Graph3D.Ribbon) # Y coordinate = 0.0


c1.setYWidth(0.3)
c1.setDataColors(Qt.red)
c1.setMeshColor(Qt.white)
c1.setMeshLineWidth(1.0)

c2 = g.addData(table("Table2"), "", "C", 1.0, Graph3D.Ribbon) # no X column, Y coordinate = ←-


1.0
c2.setYWidth(0.3)
c2.setDataColors(Qt.green)
c2.setMeshColor(Qt.white)
c2.setMeshLineWidth(1.0)

g.setAxisScale(Qti3D.Y1, -0.5, 1.5, 0.0, 2, 0) # set scale and ticks for Y axis
g.findBestLayout()

7.2.15.4 Working with curves

It is possible to iterate through the curves in a 3D plot like shown in the script bellow:
g = newPlot3D()
g.plotXYY(table("Table1"), ("C", "D", "E", "F"), Graph3D.Bars)
g.setSpecialLabelDisplay(Graph3D.ColumnName)
for i in range(0, g.curveCount()):
c = g.curve(i)
c.setMeshColor(Qt.white)
c.setMeshLineWidth(1.5)
The QtiPlot Handbook 409 / 452

For 3D plots displaying XYY curves, the method setSpecialLabelDisplay, used in the example above, specifies how the tick
labels for the Y axis are handled by QtiPlot. There are five options available:

0. Graph3D.TickValue
1. Graph3D.ColumnName
2. Graph3D.ColumnComment
3. Graph3D.ColumnLongName
4. Graph3D.ColumnFullName

3D curves can be removed from a plot window using either their index or their reference:
g = newPlot3D()
g.plotXYY(table("Table1"), ("C", "D", "E", "F"), Graph3D.Bars)# plot 4 curves
g.removeCurve(0) # 3 curves left
g.removeCurve(g.curve(0)) # 2 curves left

It is possible to remove all curves created from the same source data table (or matrix) like shown bellow:
g = newPlot3D()
t = table("Table1")
g.plotXYY(t, ("C", "D", "E"), Graph3D.Bars)# plot 3 curves
g.removeData(t) # no curves left

For large data sets you can increase the drawing speed by reducing the number of points taken into account. The lower the
resolution parameter, the higher the number of points used: for an integer value of 1, all the data points are drawn.
g = newPlot3D()
c1 = g.addMatrix(matrix("Matrix1"))
c1.setResolution(2)
c2 = g.addMatrix(matrix("Matrix2"))
c2.setResolution(3)

7.2.15.5 Curve colors

The default color map of a 3D curve/surface is defined using a rainbow color map. It is possible to change the default colors:
c.setDataColors(Qt.blue)
c.setDataColors(Qt.black, Qt.green)

Of course, one can define more complex color maps, using LinearColorMap objects:
map = LinearColorMap(Qt.green, Qt.black)
map.setMode(LinearColorMap.FixedColors) # default mode is LinearColorMap.ScaledColors
map.addColorStop(0.2, Qt.yellow)
map.addColorStop(0.5, Qt.red)
map.addColorStop(0.7, Qt.blue)
c.setDataColorMap(map)

Also, it is possible to use predefined color maps stored in .map files. A .map file consists of a of 255 lines, each line defining a
color coded as RGB values. A set of predefined color map files can be downloaded from QtiPlot web site.
c.setDataColorMap("/Users/ion/qtiplot/colormaps/PEACH.MAP")

Finally, one can customize the transparency of a curve. The transparency parameter must lie within the range (0.0, 1.0):
c.setTransparency(0.75)
The QtiPlot Handbook 410 / 452

7.2.15.6 Curve labels

In the case of 3D curves created from tables, QtiPlot can display symbol labels like in the example bellow:
g = newPlot3D()
g.plotXYY(table("Table1"), ("C", "D", "E"), Graph3D.Bars)
g.setSpecialLabelDisplay(Graph3D.ColumnName)
for i in range(0, g.curveCount()):
c = g.curve(i)
c.setLabelsForm(Curve3D.XYZValues);
c.setVisibleLabels()
c.setLabelsColor(Qt.blue)
c.setLabelsFont(QFont("Arial", 12, QFont.Bold))
c.setLabelsRotation(90.0)
c.setLabelsNumericPrecision(3)
c.setLabelsOffset(20, 0, 50)

The labels may have one of the following predefined forms:

0 Curve3D.XValues
1 Curve3D.YValues
2 Curve3D.ZValues
3 Curve3D.RowIndices

4 Curve3D.XYValues
5 Curve3D.XYZValues

You may also specify the labels using the texts in a table column:
c.setLabelsColumnName("Table1_2")

7.2.15.7 Curve style

The style of the 3D curve/surface can be modified using the following functions:
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setResolution(3)
c.setPlotStyle(Qti3D.FILLED)
c.setDataColors(Qt.black, Qt.white) # set gray scale color map
c.setShading(Qti3D.CONTOURS)

The following styles are available for the shading:

Qti3D.FLAT (0) The GL_FLAT shading mode from OpenGL: the color of a polygon in the 3D surface is given by only one of
its vertices.
Qti3D.GOURAUD (1) The GL_SMOOTH shading mode from OpenGL: the colors of all vertices composing a polygon are
interpolated, assigning different colors to each resulting pixel fragment of the rendered surface.
Qti3D.CONTOURS (2) The polygons composing the rendered surface are filled to the isoline contours.

Qti3D.CONTOURS2 (3) Same as previous method: the polygons composing the rendered surface are filled to the isoline
contours. This method is less accurate than CONTOURS and may fail for very complex data, but is a litle bit faster and
gives nicer results for smooth surfaces.
The QtiPlot Handbook 411 / 452

7.2.15.8 Floor projection

By default, the floor projection of a 3D surface is disabled. One can enable a full 2D projection or only display the isolines using
the following floor projection styles:

Qti3D.NOFLOOR (0) Empty floor.


Qti3D.FLOORISO (1) The isoline projections are visible.
Qti3D.FLOORDATA (2) The projected polygons visible.

If the floor style is set to Qti3D.FLOORISO, the number of projected isolines can be customised using the function setIsolines:
c = newPlot3D().addFunction("x*y", -1.0, 1.0, -1.0, 1.0, -1.0, 1.0)
c.setFloorStyle(Qti3D.FLOORISO)
c.setIsolines(30)
c.setFloor(Qti3D.CustomPlane, 0.5)

By default, the floor plane is the Z plane that contains the minimum vertex. It is possible to change this setting using one of
values bellow:

Qti3D.ZeroPlane (0) Zero plane.


Qti3D.MinVertex (1) The Z plane that contains the minimum data vertex.
Qti3D.MaxVertex (2) The Z plane that contains the maximum data vertex.
Qti3D.CustomPlane (3) A custom Z value.

7.2.15.9 Surface normals

In three dimensions, a surface normal, or simply normal, to a surface at point P is a vector perpendicular to the tangent plane of
the surface at P. In QtiPlot the normals can be enabled only for 3D plots created from matrices or from mathematical functions.
The display of the surface normals can be enabled and customised like in the example bellow:
c = newPlot3D().addFunction("x*y", -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 20, 20)
c.setPlotStyle(Qti3D.HIDDENLINE)
c.setNormalLength(0.07) # length of the arrow line
c.setNormalColor(Qt.red) # color of the arrow line
c.setNormalWidth(1.5) # width of the arrow line
c.setNormalQuality(4) # number of arrow sides
c.setNormalArrowAngle(10.0)
c.setNormalArrowLength(0.5) # length of the arrow head
c.setFilledNormalArrow(True)
c.setSmoothNormalArrow(False)
c.showNormals(True)

7.2.15.10 Curve symbols

The symbols available for 3D scatter plots are: dots, bars, cones, crosses and cubes. These symbols can be enabled using the
functions bellow:
c.setDotOptions(5, True)
c.setBarOptions(0.5, True, True, 0.2)
c.setConeOptions(0.1, 3, True, False, 0.0)
c.setCrossOptions(1.5, 1.5)
c.setCubeOptions(0.8, 1.5, True, False, Qt.blue)
The QtiPlot Handbook 412 / 452

Dot symbols can be enabled using the function setDotOptions. The first parameter of this function specifies the size of the
points and the second determines their shape: circles if True (the default), rectangles otherwise:
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setDotOptions(5, False) # display rectangles

The getter functions for the properties of the dots are listed bellow:
c.pointSize()
c.hasSmoothPoints()

The first parameter of the function setBarOptions is the width of the bar in the X direction, the second specifies whether the
bar edges should be drawn, the third enables/disables collor filling and the forth specifies the width of the bar in the Y direction:
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setBarOptions(0.5, True, True, 0.2)

The getter functions for the properties of the bars are listed bellow:
c.barRadiusX()
c.barRadiusY()
c.hasBarEdges();
c.hasFilledBars()

The first parameter of the function setConeOptions determines the width of the base, the second is the number of sides of
the base polygon, the third enables/disables collor filling, the forth specifies if the cones are drawn upward or downward and the
last parameter is the height of the cones:
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setConeOptions(0.1, 3, True, False, 0.0) # display filled triangles

The getter functions for the properties of the cones are the following:
c.coneRadius()
c.coneHeight()
c.coneQuality()
c.hasFilledCones()
c.hasUpwardCones()

The first parameter of the function setCrossOptions determines the size of the cross symbol, the second the width of the
line and the third specifies whether the crosses should be surrounded or not by a box frame (the default value for this parameter
is False):
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setCrossOptions(1.5, 1.5)

The getter functions for the properties of the crosses are listed bellow:
c.crossRadius()
c.crossLineWidth()
c.hasBoxedCrosses()

The first parameter of the function setCubeOptions determines the size of the cube, the second the width of the line, the
third specifies whether the cube edges should be drawn or not, the forth enables/disables the color filling of the cube sides and
the last one sets the color of the cube edges:
c = newPlot3D().addMatrix(matrix("Matrix1"))
c.setCubeOptions(0.8, 1.5, True, False)

The getter functions for the properties of the cubes are listed bellow:
The QtiPlot Handbook 413 / 452

c.cubeRadius()
c.cubeLineWidth()
c.hasCubeEdges()
c.hasFilledCubes()
c.cubeEdgeColor()

3D scatter plots can also be created using data stored in table columns, like in the example bellow, which creates for curves with
different 3D symbols:
g = newPlot3D()

c1 = g.addData(table("Table1"), "A", "B", "C")


c1.setDataColors(Qt.red)
c1.setMeshColor(Qt.red)
c1.setMeshLineWidth(1.5)
c1.setDotOptions(10, False) #display rectangles
c1.setLineSymbolStyle(Curve3D.Dots)

c2 = g.addData(table("Table2"), "A", "B", "D")


c2.setDataColors(Qt.green)
c2.setMeshColor(Qt.green)
c2.setMeshLineWidth(1.5)
c2.setCubeOptions(0.5, 1.5, True, False)
c2.setLineSymbolStyle(Curve3D.Cubes)

c3 = g.addData(table("Table2"), "A", "B", "E")


c3.setDataColors(Qt.blue)
c3.setMeshColor(Qt.blue)
c3.setMeshLineWidth(1.5)
c3.setCrossOptions(0.5, 1.5)
c3.setLineSymbolStyle(Curve3D.Cross)

c4 = g.addData(table("Table2"), "A", "B", "F", Graph3D.Bars)


c4.setDataColors(Qt.darkMagenta)
c4.setMeshColor(Qt.white)
c4.setMeshLineWidth(1.5)
c4.setBarOptions(0.5, True, True, 0.5)

g.setScales(0, 11, 0, 11, 0, 1, False)

7.2.15.11 Drop Lines

For 3D curves created from data tables, it is possible to display drop lines:
c = newPlot3D().addData(table("Table1"), "A", "B", "C", Graph3D.LineSymbols)
c.enableDropLines(True)
c.setDropLineColor(Qt.red)
c.setDropLineWidth(2)
c.setDropLineStyle(Qti3D.SHORTDASH)

7.2.15.12 3D Bars

When working with 3D bars, there are a few functions that might be very useful. The first one is setBasePlane. It allows to
specify the base plane for the bars. Its argument can be either Qti3D.Zero (base plane is Z = 0) or Qti3D.MinVertex (the
base plane is set to the minimum value of the Z axis).
The function setOffset can be used in order to impose an offset in both X and Y directions. The arguments of this function
are percentages of the X and Y sizes of the bars, respectively.
The QtiPlot Handbook 414 / 452

The third function, setSquareBars, can be used in order to set equal sizes in X and Y directions. You must note that the
dimensions of the bars depend on the X and Y dimensions of the 3D plot. If the length of the Y axis is visibly larger than the
length of the X axis, than the bars will not have a square form, even if you have used this function with a True argument.
bars = newPlot3D().addData(table("Table2"), "A", "B", "F", Graph3D.Bars)
bars.setDataColors(Qt.red)
bars.setBasePlane(Qti3D.MinVertex)
bars.setOffset(0.5, 0.2)
bars.setSquareBars(True)
bars.setBarOptions(0.4)

7.2.15.13 Color Scale Legends

Depending on your user settings, QtiPlot creates or not a 3D color scale legend for each 3D curve. The script bellow shows how
to get a reference to an existing color scale object or how to create a new one:
g = newPlot3D()
c = g.addMatrix(matrix("Matrix1"))
l = g.colorScale(c) # get a reference to the color legend object
if not l:
l = g.addColorScaleLegend() # create new legend
l.attachTo(c) # attach new legend to curve

An existing 3D color scale legend can be modified using the following functions:
l.setVisible(True) # make legend visible if hidden
#l.setGeometry(QRect(450, 20, 10, 100)) # set geometry of the color bar in pixel ←-
coordinates
l.setGeometry(90, 5, 3, 30)# set geometry using percentages of the plot dimensions

l.setOrientation(ColorScale3D.BottomTop)
l.setAxisPosition(ColorScale3D.Right)

l.setTitleString("My Legend")
l.setTitleColor(Qt.darkGreen)
l.setTitlePosition(ColorScale3D.Top)
l.setTitleGap(2) # set gap between title and color legend
l.setTitleFont("Courier", 12, QFont.Bold, True)

l.drawNumbers(True) # enable scale numbers


l.setBorderEnabled(True) # enable border
l.setBorderColor(Qt.darkGray)
l.setBorderWidth(1.0)
l.setColorBarEnabled(True) # the color bar will be drawn

a = l.axis() # get a reference to the axis object


a.setNumberColor(Qt.blue)
a.setNumberFont("Courier", 11, QFont.Bold, True)
a.setNumbersGap(2) # set gap between axis and numbers
a.setNumericFormat(Qti3D.Decimal, 1)

a.enableTicks(True) # turn ticks drawing on


a.enableBackbone(False) # disable axis backbone
a.setLineWidth(1.0)
a.setColor(Qt.darkGray)
a.setStep(0.1); # set scale step
a.setMinorIntervals(2) # display one minor tic (2 minor intervals)
a.setTickLength(1, 0.5)
The QtiPlot Handbook 415 / 452

There are two options for the orientation of the color bar: ColorScale3D.BottomTop (0), the color bar is drawn vertically,
the lowest color index is on the bottom and ColorScale3D.LeftRight (1), the color bar is drawn horizontally, the lowest
color index is on the left side.
The following positions can be used for the axis and/or the title of the color scale legend:

ColorScale3D.Top (0) Axis/Title on top.


ColorScale3D.Bottom (1) Axis/Title at the bottom.
ColorScale3D.Left (2) Axis/Title on the left side.
ColorScale3D.Right (3) Axis/Title on the right side.

The script bellow shows how to access the properties of an existing color scale legend:
visible = l.isVisible()
hasAxis = l.isAxisEnabled() # True if the legend scale is displayed
border = l.isBorderEnabled() # True if the legend border is displayed
bw = l.borderWidth()
bc = l.borderColor()
filled = l.isColorBarEnabled() # True if the color bar is displayed
o = l.orientation() # legend orientation (vertical or horizontal)
axisPos = l.axisPosition() # position of the axis
titlePos = l.titlePosition() # position of the title

a = l.axis() # get a reference to the legend axis

drawTicks = a.hasTicks() # whether scale drawing is on or off


drawNumbers = a.hasNumbers() # whether number drawing is on or off
drawBackbone = a.hasBackbone() # whether backbone drawing is enabled

step = a.step() # get step value


majLength = a.majorTickLength() # length of major ticks
minLength = a.minorTickLength() # length of minor ticks

majors = a.majorIntervals() # number of major intervals


minors = a.minorIntervals() # number of minor intervals

font = a.numberFont() # font used for tick labels


gap = a.numbersGap() # distance axis - tick labels

prec = a.numericPrecision() # numeric precision for tick labels


fmt = a.numericFormat() # numeric format for tick labels
lw = a.lineWidth();

Color scale legends can be removed from a 3D plot like in the example bellow:
g = plot3D("Graph1")
l1 = g.colorScale(0)
l2 = g.colorScale(1)
g.removeColorScale(l1)
g.removeColorScale(l2)

7.2.15.14 3D Legends

It is very easy to add a legend to a 3D plot:


g = newPlot3D()
g.plotXYY(table("T275K"), ("C", "D", "E", "F"), Graph3D.Trajectory)
g.newLegend()
The QtiPlot Handbook 416 / 452

The legends in a 3D plot are in fact groups of texts and color scale objects and can be removed using their reference or their
index. Please keep in mind the fact that removing a group does’t also remove its child elements.
g = newPlot3D()
group = g.newLegend()
g.removeGroup(group)

g.newLegend()
g.removeGroup(0)

print(g.groupCount())

The example bellow demonstrates how to build a custom legend object for a 3D plot:
g = newPlot3D()
g.plotXYY(table("T275K"), ("C", "D", "E", "F"), Graph3D.Trajectory)

group = g.addGroup()

t = g.addText("My Legend")
t.move(85, 5)
group.addText(t)

for i in range(0, g.curveCount()):


l = g.addColorScaleLegend()
l.attachTo(g.curve(i)) # attach color scale to a curve
l.drawNumbers(False) # disable scale numbers
l.setTitleString("%(" + str(i + 1) + ")")
l.setTitlePosition(ColorScale3D.Right)
l.move(85, 11 + 5*i)
group.addColorScale(l)

group.setFrameEnabled(True)
group.setFrameColor(Qt.blue)
group.setFrameWidth(1.5)
group.setBackgroundColor(Qt.lightGray)
group.setMargin(7)
group.setShadow(True, Qt.blue, 4)
group.setTextColor(Qt.blue)
group.setFont(QFont("Arial", 12))
group.setSymbolSize(QSize(20, 10)) # set color scale sizes
group.setSymbolBorder(False) # disable color scale borders
group.setFilledSymbols(True)

7.2.15.15 Lighting

Lighting can also be enabled programmatically for 3D plots. The light parameters can be customized like in the example bellow:
g = newPlot3D()
c = g.addMatrix(matrix("FUNC"))
c.setPlotStyle(Qti3D.FILLED)
c.setShading(Qti3D.CONTOURS)

g.enableLighting(True)
g.setAmbientLight(Qt.blue, 0.2)
g.setDiffuseLight(QColor("orange"), 0.93)
g.setSpecularLight(Qt.yellow, 0.94)
g.setShininess(56)
g.setLightEmission(0.03)
g.setLightDirection(90, 20)
The QtiPlot Handbook 417 / 452

The direction of the light, coming from a distant source, is given by two angles. The horizontal angle can take any value between
0 and 360 degrees and the vertical angle can take any value between -180 and 180 degrees.
The following getter funcions can be used to retrieve the lighting parameters of a 3D plot:
g.lightingEnabled()
g.ambientLightColor()
g.ambientLightIntensity()
g.diffuseLightColor()
g.diffuseLightIntensity()
g.specularLightColor()
g.specularLightIntensity()
g.shininess()
g.lightEmission()
g.horizontalLightAngle()
g.verticalLightAngle()

7.2.15.16 The coordinate system

One can fully customize the appearance of the coordinate system in a 3D plot, using the functions bellow:
g.setAutoDecorateAxes(False)
g.setCoordinateStyle(Qti3D.RHALFBOX, Qti3D.X1, Qti3D.Y1, Qti3D.Z3)
g.setOrthogonal(True)

The method setAutoDecorateAxes, used in the example above, specifies how the decorated axes are chosen by QtiPlot: automat-
ically or using the axes specified by the setCoordinateStyle method. The setAutoDecorateAxes function should be called before
the setCoordinateStyle method.
The following coordinate system styles are available:

Qti3D.NOCOORD (0) The coordinate system is not visible.


Qti3D.BOX (1) The coordinate system is drawn as a box: all 12 axes are visible, but only three of them are decorated with ticks
and numbers.
Qti3D.FRAME (2) Only three axes are visible.
Qti3D.RHALFBOX (3) Three sides of the box are visible: the right side, the back and the floor.
Qti3D.LHALFBOX (4) Three sides of the box are visible: the left side, the back and the floor.

The coordinates system can also be customized to display all the twelve axes, only three of them or none, respectively, with the
help of the following functions:
g.setBoxed()
g.setFramed()
g.setNoAxes()

The twelve axes of the coordinate system can be accesed using the following indices or names:

Qti3D.X1 (0) 1st x axis


Qti3D.Y1 (1) 1st y axis
Qti3D.Z1 (2) 1st z axis
Qti3D.X2 (3) 2nd x axis
Qti3D.X3 (4) 3rd x axis
The QtiPlot Handbook 418 / 452

Qti3D.X4 (5) 4th x axis


Qti3D.Y4 (6) 4th y axis
Qti3D.Y3 (7) 3rd y axis
Qti3D.Y2 (8) 2nd y axis
Qti3D.Z2 (9) 2nd z axis
Qti3D.Z3 (10) 3rd z axis
Qti3D.Z4 (11) 4th z axis

The perspective view mode can be enabled/disabled using:


g.setOrthogonal(True)

If the axes are enabled, you can set their legends and the distance between the legend and the axis via:
g.setXAxisLabel("X axis legend")
g.setYAxisLabel("Y axis legend")
g.setZAxisLabel("Z axis legend")
g.setLabelsDistance(30)

It is possible to set the numerical format and precision of the axes using the function below:
g.setAxisNumericFormat(axis, format, precision)

where the first parameter is the index of the axis: 0 for X, 1 for Y and 2 for Z, the second one is the numerical format:

0. Qti3D.Default: decimal or scientific, depending which is most compact


1. Qti3D.Decimal: 10000.0
2. Qti3D.Scientific: 1.0e+04 (lower case scientific format)
3. Qti3D.Engineering: 10k
4. Qti3D.Superscripts: 1x104
5. Qti3D.SuperscriptsGER: 1·104
6. Qti3D.ScientificUpperCase: 1.0E+04 (upper case scientific format)

and the last parameter is the precision (the number of significant digits).
The following convenience functions are also provided, where you don’t have to specify the index of the axis anymore:
g.setXAxisNumericFormat(1, 3)
g.setYAxisNumericFormat(1, 3)
g.setZAxisNumericFormat(1, 3)

Also, you can set the length of the major and minor ticks of an axis:
g.setXAxisTickLength(2.5, 1.5)
g.setYAxisTickLength(2.5, 1.5)
g.setZAxisTickLength(2.5, 1.5)

The scale division of an axis can be customized like shown bellow:


g.setAxisScale(Qti3D.X1, 0, 11) # set scale for X axis
g.setAxisScale(Qti3D.Y1, 0.0, 1.5, 0.5, 4, 0) # set scale limits, step and ticks for Y axis
The QtiPlot Handbook 419 / 452

It is possible to fine tune the scale divisions of an axis by imposing the value of the first major tick:
g.setAxisFirstMajorTick(Qti3D.Y1, 0.1)
g.updateGL()

The colors of all the axes elements can be customized as shown below:
g.setAxesColor(Qt.darkGray)
g.setNumbersColor(Qt.blue)
g.setLabelsColor(QColor("darkRed"))

The properties of the twelve axes can be retrieved by first getting a reference to each axis, like shown bellow:
a = g.axis(Qti3D.Y1)
print(a.label().string())
print(a.lowerBound(), a.upperBound(), a.step(), a.firstMajorTick())
print(a.majorIntervals(), a.minorIntervals())

A reference to the title object of an axis can be retrieved and used in order to customise it, like shown bellow:
l = a.label()
l.setString("Axis title<br>has two lines!")
l.setAlignment(Qt.AlignCenter)
l.setColor(Qt.blue)
l.setFont(QFont("Arial", 12))

It is possible to set a color filling for the six sides of the coordinate system. Please note that transparency of these planes is not
correctly handled when exporting 3D plots to vectorial image formats (*.EPS, *PDF or *.SVG files):
g = newPlot3D()
g.addFunction("sin(x*y)", -2.0, 2.0, -2.0, 2.0, -1.0, 1.0)

color = QColor(Qt.gray)
color.setAlphaF(0.7)
g.setLeftPlaneColor(color)

color = QColor(Qt.red)
color.setAlphaF(0.4)
g.setFrontPlaneColor(color)

color = QColor(Qt.blue)
color.setAlphaF(0.5)
g.setCeilPlaneColor(color)

g.setRightPlaneColor(Qt.yellow)
g.setBackPlaneColor(Qt.cyan)
g.setFloorPlaneColor(Qt.gray)

In order to disable the color filling for any of the sides, simply assign an invalid color to it:
g.setFrontPlaneColor(QColor())

The six colors of the coordinate system planes can be retrieved using the functions listed bellow:
leftColor = g.leftPlaneColor()
rightColor = g.rightPlaneColor()
backColor = g.backPlaneColor()
frontColor = g.frontPlaneColor()
floorColor = g.floorPlaneColor()
ceilColor = g.ceilPlaneColor()

It is also possible to define a colored border for the six sides of the coordinate system:
The QtiPlot Handbook 420 / 452

g = newPlot3D()
g.addFunction("sin(x*y)", -2.0, 2.0, -2.0, 2.0, -1.0, 1.0)

color = QColor(Qt.white)
color.setAlphaF(0.0)
g.setRightPlaneColor(color)
g.setBackPlaneColor(color)
g.setFloorPlaneColor(color)
g.setNoAxes()

g.setPlaneBorder(True, Qt.gray, 1.5, Qti3D.SHORTDASH)

The properties of the border can be retrieved using the functions listed bellow:
color = g.planeBorderColor()
lw = g.planeBorderWidth()
ls = g.planeBorderStyle()
on = g.isPlaneBorderEnabled()

7.2.15.17 The grid

If the coordinate system is visible, you can also display a grid around the surface plot. The example bellow shows how to fully
customize the appearance of the grids in a 3D plot:
g.setGrid(Qti3D.RIGHT | Qti3D.BACK)

g.setMajorGridLines(Qti3D.X1, True, Qt.black, Qti3D.DASH, 1.0)


g.setMinorGridLines(Qti3D.X1, True, Qt.blue, Qti3D.SHORTDASH, 1.0)

g.setMajorGridLines(Qti3D.Y1, True, Qt.black, Qti3D.DASH, 1.0)


g.setMinorGridLines(Qti3D.Y1, True, Qt.green, Qti3D.SHORTDASH, 1.0)

g.setMajorGridLines(Qti3D.Z1, True, Qt.red, Qti3D.DASH, 1.0)


g.setMinorGridLines(Qti3D.Z1, False)

The following options are available for the setGrid method:

Qti3D.NOSIDEGRID (0) The grid is not visible.


Qti3D.LEFT (1) The left side of the grid.

Qti3D.RIGHT (2) The right side of the grid.


Qti3D.CEIL (4) The ceil.
Qti3D.FLOOR (8) The floor.

Qti3D.FRONT (16) The front side.


Qti3D.BACK (32) The back side.

There are eight pen styles available for the customization of the grid lines:

Qti3D.SOLID (0)
Qti3D.DASH (1)

Qti3D.DOT (2)
The QtiPlot Handbook 421 / 452

Qti3D.DASHDOT (3)
Qti3D.DASHDOTDOT (4)
Qti3D.SHORTDASH (5)

Qti3D.SHORTDOT (6)
Qti3D.SHORTDASHDOT (7)

Additionally, each side of the grid can also be shown or hidden using the functions bellow:
g.setLeftGrid(True)
g.setRightGrid()
g.setCeilGrid()
g.setFloorGrid()
g.setFrontGrid()
g.setBackGrid(False)

7.2.15.18 The plot title

It is possible to add a title to a 3D plot like shown in the example bellow:


g = newPlot3D()
t = g.setTitle("My beautiful 3D plot", Qt.blue, QFont("Arial", 16, QFont.Bold))
t.setFrameColor(Qt.blue)
t.setMargin(5)
t.draw()

7.2.15.19 Ading texts

It is possible to add several text objects to a 3D plot, not only a title, using the addText method. By default, the new text objects are
placed at the top left corner of the plot window. You may customise the position of a text using pixel coordinates or percentages
of the plot dimensions:
g = newPlot3D()
g.addText("Test")

t = g.addText("My Text", QFont("Arial", 14), Qt.blue)


#t.move(QPoint(50, 100)) # set position using pixel coordinates
t.move(50, 10) # set position using percentages of the plot dimensions

Existing 3D text objects can be customized like shown bellow:


g = plot3D("Graph1")
l = g.text(0) # use text index to get a pointer
l.setString("Test")
l.setFont(QFont("Arial", 20))
l.setColor(Qt.blue) # set text color
l.setFrameColor(Qt.blue)
l.setFrameWidth(1.5)
l.setShadow(True, Qt.blue, 4)
l.setBackgroundColor(Qt.white)
l.setAngle(90.0)
l.setMargin(5)
g.updateGL() # update plot window

Text objects can be removed from a 3D plot like in the example bellow:
The QtiPlot Handbook 422 / 452

g = plot3D("Graph1")
t1 = g.text(0)
t2 = g.text(1)
g.removeText(t1)
g.removeText(t2)

7.2.15.20 3D Vectors

It is possible to plot 3D vectors using as data source a table that has at least six columns. The code bellow creates a 3D curve
with vector type XYZ dXdYdZ and returns a reference to this curve:
t = table("Table1")
c = newPlot3D().addVectors(t, t.colNames(), True)

The second argument of the addVectors function is a string list that must contain six column names. If the third argument is
not specified the type of the 3D vectors is by default set to XYZ XYZ.
Once created the type and the names of the data columns defining the end point of the 3D vector may be changed as shown
bellow. The second argument of the setVectorEndZColName function is true in order to reload the data only once (the
default value is False):
c.setDxDyDz(False)
c.setVectorEndXColName("Table1_A")
c.setVectorEndYColName("Table1_B")
c.setVectorEndZColName("Table1_C", True)

print c.isDxDyDz()
print c.vectorEndXColName()
print c.vectorEndYColName()
print c.vectorEndZColName()

The appearance of a 3D vectors curve c can be customized using the following functions:
c.setVectorColor(Qt.red)
c.setVectorLineWidth(2.0)
c.setVectorScalingFactor(0.75)

print c.vectorLineWidth()
print c.vectorScalingFactor()

The style of the arrow can be customized using the setArrowStyle function. The first argument of this function is the head
length, the second specifies the value in degrees of the head angle, the third is the quality, that is the number of facets used
to draw the arrow head, the forth specifies weather the head is filled or not and the last argument sets the scaling policy for the
arrow head. The value of the last argument may be: 0 - no scaling, 1 - logarithmic scaling or 2 - linear scaling.
c.setArrowStyle(0.5, 30, 4, False, 1)

print c.vectorHeadLength()
print c.vectorHeadAngle()
print c.arrowQuality()
print c.hasFilledArrowHead()
print c.vectorScaleHeadPolicy()

7.2.15.21 Exporting

In order to export a 3D plot you need to specify a file name containing a valid file format extension:
g.export(fileName)
The QtiPlot Handbook 423 / 452

This function uses some default export options. If you want to customize the exported image, you should use the following
function in order to export to raster image formats:
g.exportImage(fileName, int quality = 100, bool transparent = False, dpi = 0, size = QSizeF ←-
(), unit = Frame.Pixel, fontsFactor = 1.0, compression = 0)

where quality is a compression factor: the larger its value, the better the quality of the exported image, but also the larger the
file size. The dpi parameter represents the export resolution in pixels per inch (the default is screen resolution), size is the
printed size of the image (the default is the size on screen) and unit is the length unit used to express the custom size and can
take one of the following values:

0. Inch
1. Millimeter
2. Centimeter

3. Point: 1/72th of an inch


4. Pixel

The fontsFactor parameter represents a scaling factor for the font sizes of all texts in the plot (the default is 1.0, meaning
no scaling). If you set this parameter to 0, the program will automatically try to calculate a scale factor. The compression
parameter can be 0 (no compression) or 1 (LZW) and is only effectif for .tif/.tiff images. It is neglected for all other raster image
formats.
3D plots can be exported to any of the following vector formats: .eps, .ps, .pdf, .pgf and .svg, using the function below:
g.exportVector(fileName, textMode = 0, sortMode = 1, size = QSizeF(), unit = Frame.Pixel, ←-
fontsFactor = 1.0)
g.exportVector("/Users/ion/Desktop/test.pdf", Qti3D.PATH, Qti3D.BSPSORT, QSizeF(800, 600))

where textMode is an integer value, specifying how texts are handled. It can take one of the following values:

Qti3D.PIXEL (0) All text will be converted to bitmap images (default).


Qti3D.NATIVE (1) Text are exported using native fonts available in the output format. May result in incorrect positioning of
the output texts.
Qti3D.TEX (2) Text output in additional LaTeX file as an overlay.
Qti3D.PATH (3) All texts will be converted to vector paths.

The sortMode parameter is also an integer value and can take one of the following values:

Qti3D.NOSORT (0) No sorting at all.

Qti3D.SIMPLESORT (1) A simple, quick sort algorithm (default).


Qti3D.BSPSORT (2) BSP sort: best algorithm, but slow.

The other parameters have the same meaning as for the export of 2D plots.
The QtiPlot Handbook 424 / 452

7.2.16 Data Analysis

7.2.16.1 Introduction

As you will see in the following subsections, the data analysis operations available in QtiPlot are: convolution/deconvolution,
correlation, differentiation, FFT, filtering, smoothing, fitting and numerical integration of data sets. Generally, you can de-
clare/initialize an analysis operation using one of the following methods, depending on the data source, which can be a 2D plot
curve or a table:
op = LogisticFit(graph("Graph1").activeLayer().curve(0), 15.2, 30.9)
op = FFTFilter(graph("Graph1").activeLayer(), "Table1_2", 1.5, 3.9)
op = LinearFit(table("Table1"), "colX", "colY", 10, 100)

In the first example the data source is a curve Table1_2, plotted in the active layer of the graph Graph1 and the abscissae range
is chosen between 1.5 and 3.9. In the second example the data source is a table Table1. The abscissae of the data set are stored
in the column called colX and the ordinates in the column colY. The data range is chosen between the 10th row and the row with
the index 100. If you don’t specify the row range, by default the whole table will be used. Not all operations support curves as
data sources, like for example: convolution/deconvolution and correlation. For these operations only table columns can be used
as data sources for the moment.
Once you have initialized an operation, you can still change its input data via the following functions:
op.setDataFromCurve(graph("Graph2").activeLayer().curve(1), 10.5, 20.1)
op.setDataFromCurve("Table1_energy", 10.5, 20.1, graph("Graph2").activeLayer())
op.setDataFromTable(table("Table1"), "colX", "colY", 10, 100)

You don’t have to specify a plot layer in the setDataFromCurve() function, if the analysis operation has already been initialized
by specifying a curve on an existing graph and you just want to treat another curve from the same plot layer.
It is possible to sort the input data before performing the analysis operation:
op.setSortData(True)

Also, when performing analysis tasks via Python scripts, there are several utility functions that can be called for all operations.
For example you can disable any graphical output from an operation or you can redirect the output to the plot layer of your
choice:
op.enableGraphicsDisplay(False)
op.enableGraphicsDisplay(True, graph("Graph2").activeLayer())

Let’s assume that you need to perform a specific operation op, which analyzes your data and at the end, displays a result curve.
For this kind of operations, you can customize the number of points in the resulting curve and its color:
op.setOutputPoints(int)
op.setColor(int)
op.setColor("green")

Colors can be specified by their names or as integer values, from 0 to 23, each integer corresponding to a predefined color: 0 -
"black", 1 - "red", 2 - "green", 3 - "blue", 4 - "cyan", 5 - "magenta", 6 - "yellow", 7 - "darkYellow", 8 - "navy", 9 - "purple", etc ...
The result plot curve generated after an anlysis operation can be accessed via the following function:
c = op.resultCurve()

Most of the time, a new table is also created as a result of a data analysis operation. This table stores the data displayed by the
result curve and is hidden by default, but you can interact with it via the following function:
t = op.resultTable()

After the initialization of an analysis operation, which consists of setting the data source, the data range and some other properties,
like color, number of points, etc..., you can execute it via a call to its run() function:
op.run()

For data fitting operations, there’s an alias for the run() function which is: fit().
The QtiPlot Handbook 425 / 452

7.2.16.2 Analysis Filters

All data analysis operations are derived from the same base class, Filter, therefore we will generically call them filters. The type
of an analysis filer can be obtained using the filterType() function. The folowing filter types are defined in the QtiPlot Python
API:

0. Filter.FitLinear
1. Filter.FitLinearSlope
2. Filter.FitPoly
3. Filter.FitExp
4. Filter.FitTwoExp
5. Filter.FitThreeExp
6. Filter.FitLogistic
7. Filter.FitSigmoidal
8. Filter.FitGaussAmp
9. Filter.FitMultiPeak
10. Filter.FitPlugIn
11. Filter.FitUser
12. Filter.Interpolate
13. Filter.Smooth
14. Filter.FindPeaks
15. Filter.Fft
16. Filter.FftFilter
17. Filter.Integrate
18. Filter.Differentiate
19. Filter.Correlate
20. Filter.Convolve
21. Filter.Deconvolve
22. Filter.MultipleLinearRegresion
23. Filter.Pareto
24. Filter.QQPlot
25. Filter.BlandAltman

In a plot layer, as a result of the various analysis operations performed on the data curves, there might be several filter objects. It
is possible to access each of these filters and to get information about them as shown in the sample script bellow:
g = graph("Graph1").activeLayer()
for i in range(0, g.filterCount()):
f = g.filter(i)
print f.filterType(), f.explanation()
if f.filterType() == Filter.FitMultiPeak:
print f.profile()
The QtiPlot Handbook 426 / 452

For all filters that display a result curve in a plot layer there is a mechanism available in QtiPlot that allows to trigger a recalcu-
lation when the data source is modified. The recalculate mode of a filter can be one of the following:

0 (NoRecalculate): no recalculation when data changes.


1 (AutoRecalculate): a recalculation is automatically performed when input data changes.
2 (ManualRecalculate): no recalculation is triggered when data changes, instead the user can perform a recalculation at any time
using the recalculate() function.

The sample script bellow shows how to access and modify the recalculate mode and how to perform a recalculation of the data
analysis operations from a plot layer:
g = graph("Graph1").activeLayer()
for i in range(0, g.filterCount()):
f = g.filter(i)
if f.recalculateMode() == Filter.AutoRecalculate:
f.setRecalculateMode(Filter.ManualRecalculate)
if f.hasModifiedData():
f.recalculate()

A filter object f can be added to a plot layer g using the addFilter method:
g = graph("Graph1").activeLayer()
g.addFilter(f)

Please note that if the recalculation policy defined via the Fitting tab of the Preferences dialog is not set to No, data fit objects are
added by default to the output graph layer. For all the other analysis filter types you need to use the addFilter function.
It is possible to remove all filter objects from a plot layer g with a single line of code:
g.deleteFilters()

It is also possible to remove individual filter objects:


for i in range(0, g.filterCount()):
g.deleteFilter(g.filter(i))

7.2.16.3 Correlation, Convolution/Deconvolution

Assuming you have a table named "Table1", here’s how you can calculate the convolution of two of its columns, "Table1_B" and
"Table1_C":
conv = Convolution(table("Table1"), "B", "C")
conv.setColor("green")
conv.run()

The deconvolution and the correlation of two data sets can be done using a similar syntax:
dec = Deconvolution(table("Table1"), "B", "C")
dec.run()

cor = Correlation(table("Table1"), "B", "C", 10, 200)


cor.setColor("green")
cor.run()
The QtiPlot Handbook 427 / 452

7.2.16.4 Differentiation

Assuming you have a Graph named "Graph1" containing one curve (on its active layer), here’s how you can differentiate this
curve within a defined x interval, [2,10] in this case:
diff = Differentiation(graph("Graph1").activeLayer().curve(0), 2, 10)
diff.run()

The result of this code sequence would be a new plot window displaying the derivative of the initial curve. The numerical
derivative is calculated using a five terms formula.
It is also possible to differentiate data directly from a table without displaying any graphical output:
diff = Differentiation(table("Table1"), "1", "2")
diff.enableGraphicsDisplay(False)
diff.run()
diff.resultTable().showNormal()

The result of the above code sequence is a new table window containing the derivative of the data from the initial table "Table1".

7.2.16.5 Pareto Charts

Pareto charts are implemented as data filtersin QtiPlot. There are two types of input data that can be used in order to generate a
Pareto chart: binned data and raw data.
In the case of binned data the input typically consists of a text column containing the categories/items and one of numbers
containing the corresponding counts or bins:
pf = ParetoFilter(table("Table1"), "Table1_Item", "Table1_Count")
pf.run()
pf.outputGraph().addFilter(pf)

In the case of raw data the input typically consists of a single text column, containing the categories/items:
pf = ParetoFilter(table("Table2"), "Table2_Items")
pf.run()
pf.outputGraph().addFilter(pf)

7.2.16.6 Bland-Altman Plots

Bland-Altman plots are implemented as data filters in QtiPlot. The easiest way to create a Bland-Altman plot, using the default
settings, is shown bellow. In this design, each of the two measurement methods is used once on each subject. You need to provide
two input data columns, one for each measurement method.
baf = BlandAltmanFilter(table("Table1"), "A", "B")
baf.run()
baf.outputGraph().addFilter(baf)

Of course, it is possible to customise the output settings:


baf = BlandAltmanFilter(table("Table1"), "A", "B", BlandAltmanFilter.Method1, ←-
BlandAltmanFilter.Ratio)
baf.showZeroLine(False)
baf.setLoaLinePen(QPen(Qt.red, 1.5))
baf.showLimitsOfAgreement(True, True)#enable LoA filling
baf.setLoaFillBrush(QColor(255, 255, 0, 25))# transparent yellow LoA filling
baf.run()
baf.outputGraph().addFilter(baf)
The QtiPlot Handbook 428 / 452

There are four display modes available for the X axis of a Bland-Altman plot:

Mean The abscissas are calculated as the arithmetic mean of the paired values. This is the default mode.

Method1 The abscissas are the values measured using the first method.
Method2 The abscissas are the values measured using the second method.
GeometricMean The abscissas are calculated as the geometric mean of the paired values.

There are three display modes available for the Y axis of a Bland-Altman plot:

DifferencePercent The ordinates are calculated as the difference of the paired values, divided by their arithmetic mean and
multiplied by 100.
Difference The ordinates are calculated as the difference of the paired values. This is the default mode.
Ratio The ordinates are calculated as the ratios of the paired values.

When repeated measurements are available, each subject being measured by each method several times, three columns of input
data are required: one with the measurements of the first method, one with the measurements of the second method and one with
the subject value. The easiest way to create a Bland-Altman plot in this case, using the default settings, is shown bellow:
baf = BlandAltmanFilter(table("Table1"), "A", "B", "C")
baf.run()
baf.outputGraph().addFilter(baf)

The default settings assume that the true value is instantaneously changing. If the true value is constant one should use the syntax
bellow. In this case pairing of the measured values by each method may not be informative and the data columns for method 1
and method 2 may have a different number of cells:
baf = BlandAltmanFilter(table("Table1"), "A", "B", "C", True)
baf.run()
baf.outputGraph().addFilter(baf)

There are two methods for calculating the confidence interval for the limits of agreement (LoA): Delta method and MOVER
(Method of Variance Estimates Recovery). By default QtiPlot uses the Delta method, but you may choose to use the MOVER
method, like shown in the script bellow:
baf = BlandAltmanFilter(table("Table1"), "A", "B", "C", True)
baf.setLoaCiMethod(BlandAltmanFilter.MOVER)
baf.run()
baf.outputGraph().addFilter(baf)

Finally, it is possible to plot each subject as one bubble. Each subject is grouped and the corresponding bubble is displayed at
mean of group (X axis) and mean difference (Y axis), the size of the bubble being proportional to the number of replicates:
baf = BlandAltmanFilter(table("Table1"), "A", "B", "C", True, True)
baf.run()
baf.outputGraph().addFilter(baf)

7.2.16.7 Q-Q Plots

Q-Q plots are implemented as data filters in QtiPlot:


The QtiPlot Handbook 429 / 452

qqf = QQPlotFilter(table("Table1"), "3")


qqf.setDistribution(QQPlotFilter.Weibull)
qqf.setScoreMethod(QQPlotFilter.Benard)
qqf.run()
qqf.outputGraph().addFilter(qqf)

distribution = qqf.distribution()
print("\nDistribution: ", qqf.distributionNames()[distribution])
print("Score method: ", qqf.scoreMethodNames()[qqf.scoreMethod()])
print("Parameters:")
lst = qqf.parameterNames(distribution)
print(lst[0], " = ", qqf.parameter1())
if (len(lst) > 1):
print(lst[1], " = ", qqf.parameter2())

There are five distributions available for Q-Q plots: Normal, Lognormal, Exponential, Weibull and Gamma.
There are also five score methods available. The input data is first ordered ascendingly and after that the index of the sorted
values is used to calculate a score using one of the formulas listed below, where N is the total number of valid values in the input
data set:

Blom (default): score = (index - 0.375)/(N + 0.25)


Benard score = (index - 0.3)/(N + 0.4)
Hazen score = (index - 0.5)/N
VanDerWaerden score = index/(N + 1)
KaplanMeier score = index/N

7.2.16.8 FFT

Assuming you have a graph named "Graph1" containing one curve on its active layer and having a periodicity of 0.1 in the time
domain, a FFT will allow you to extract its characteristic frequencies. The results will be stored in a hidden table named "FFT1".
fft = FFT(graph("Graph1").activeLayer().curve(0))
fft.normalizeAmplitudes(False)
fft.shiftFrequencies(False)
fft.setSampling(0.1)
fft.run()

By default the calculated amplitudes are normalized and the corresponding frequencies are shifted in order to obtain a centered
x-scale. If we want to recover the initial curve with the help of the inverse transformation, we mustn’t modify the amplitudes and
the frequencies. Also the sampling parameter must be set to the inverse of the time period, that is 10. Here’s how we can perform
the inverse FFT, using the "FFT1" table, in order to recover the original curve:
ifft = FFT(table("FFT1"), "Real", "Imaginary")
ifft.setInverseFFT()
ifft.normalizeAmplitudes(False)
ifft.shiftFrequencies(False)
ifft.setSampling(10)
ifft.run()

It is possible to apply a window function to the input data:


fft = FFT(graph("Graph1").activeLayer().curve(0))
fft.setWindow(FFT.GaussianWindow, 2.0)
fft.setSampling(0.001)
fft.run()
The QtiPlot Handbook 430 / 452

The window functions, w(i), available in QtiPlot are listed bellow, N being the total number of points in the input data sample
and i the index of the data point, i = 0, 1,..., N - 1:

RectangularWindow w(i) = 1. The input data is not altered.


WelchWindow w(i) = 1 - [2(i - 0.5*(N - 1))/(N + 1)]2
TriangularWindow w(i) = 2/N[N/2 - |i - N/2|]
BartlettWindow w(i) = 2/(N - 1)*[(N - 1)/2 - |i - (N - 1)/2|]

HanningWindow w(i) = 0.5*[1 - cos[2πi/(N - 1))]


HammingWindow w(i) = 0.54 - 0.46 cos[2πi/(N - 1)]
BlackmanWindow w(i) = 0.42 - 0.5 cos[2πi/(N - 1)] + 0.08 cos[4πi/(N - 1)]
GaussianWindow w(i) = exp[-0.5(2α(i - N/2)/N)2 ], where α is the second argument of the setWindow method.

It is possible to customize the type of plot created as a result of the FFT operation, using the setPlotType method. The fol-
lowing default plot types are available: FFT.RealPlot, FFT.ImagPlot, FFT.MagnitudePlot, FFT.AmplitudePlot, FFT.PhasePlot,
FFT.dBPlot, FFT.AmplitudePhasePlot and FFT.RealImagPlot.
fft = FFT(graph("Graph1").activeLayer().curve(0))
fft.setSampling(0.001)
fft.setPlotType(FFT.AmplitudePlot)
fft.run()

You can also perform 2D fast Fourrier transforms on matrices. The FFT routine takes in this case the following parameters: rm
- specifies the real part input matrix, im - specifies the imaginary part input matrix, inverse - specifies the direction of the FFT,
DCShift - if this is true, the DC component will be put in the center of the result matrix, otherwise, the DC component will locate
at four corners of the result matrix, norm - specifies whether or not to normalize the amplitudes to 1, outputPower2Sizes - forces
output matrices whose sizes are integer powers of 2 (zero padding is used to initialize the missing cells)
fft = FFT(Matrix *rm, Matrix *im = NULL, bool inverse = False, bool DCShift = True, bool ←-
norm = False, bool outputPower2Sizes = True)

Here’s how you can perform the 2D FFT of a matrix called "Matrix1", and the inverse FFT in order to recover the original image:
from qti import *
m = matrix("Matrix1")
m.setViewType(Matrix.ImageView) # make sure the matrix is displayed as image

fft = FFT(m)
fft.run()
fft.amplitudesMatrix().resize(500, 400)

rMatrix = fft.realOutputMatrix()
rMatrix.hide()
iMatrix = fft.imaginaryOutputMatrix()
iMatrix.hide()

ifft = FFT(rMatrix, iMatrix, True)


ifft.run()
ifft.realOutputMatrix().hide()
ifft.imaginaryOutputMatrix().hide()
The QtiPlot Handbook 431 / 452

7.2.16.9 FFT Filters

In this section, it will be assumed that you have a signal displayed in a graph ("Graph1", on its active layer). This signal has
a power spectrum with high and low frequencies. You can filter some of these frequencies according to your needs, using a
FFTFilter. Here’s how you can cut all the frequencies lower than 1 Hz:
filter = FFTFilter(graph("Graph1").activeLayer().curve(0), FFTFilter.HighPass)
filter.setCutoff(1)
filter.run()

Here’s how you can cut all the frequencies lower than 1.5 Hz and higher than 3.5 Hz. In the following example the continuous
component of the signal is also removed:
filter.setFilterType(FFTFilter.BandPass)
filter.enableOffset(False)
filter.setBand(1.5, 3.5)
filter.run()

Other types of FFT filters available in QtiPlot are: low pass (FFTFilter.LowPass) and band block (FFTFilter.BandBlock).

7.2.16.10 Fitting

Assuming you have a graph named "Graph1" displaying a curve entitled "Table1_2" on its active layer, a minimal Fit example
would be:
f = GaussFit(graph("Graph1").activeLayer().curve(0))
f.guessInitialValues()
f.fit()

This creates a new GaussFit object on the curve, lets it guess the start parameters and does the fit. The following fit types are
supported:

• LinearFit(curve)

• LinearSlopeFit(curve)
• PolynomialFit(curve, degree=2, legend=False)
• ExponentialFit(curve, growth=False)

• TwoExpFit(curve)
• ThreeExpFit(curve)
• GaussFit(curve)
• GaussAmpFit(curve)

• LorentzFit(curve)
• LogisticFit(curve)
• SigmoidalFit(curve)

• PsdVoigt1Fit(curve)
• PsdVoigt2Fit(curve)
• MultiPeakFit(curve, xStart, xEnd, profile=MultiPeakFit.Gauss, peaks=1)
The QtiPlot Handbook 432 / 452

f = MultiPeakFit(graph("Graph1").activeLayer().curve(0),100,900,MultiPeakFit.PsdVoigt1,3)
f.guessInitialValues()
f.setPeakCurvesColor(Qt.green)
f.generateFunction(True, 1000)
f.run()

The following peak profile functions are available: Gauss, Lorentz, PsdVoigt1 and PsdVoigt2.
• NonLinearFit(curve)
f = NonLinearFit(layer, curve)
f.setFormula(formula_string)
f.save(fileName)

• PluginFit(curve)
f = PluginFit(curve)
f.load("/Applications/qtiplot.app/Contents/MacOS/fitPlugins/libexp_saturation.dylib")

For each of these, you can optionally restrict the X range that will be used for the fit, like in:
f = LinearFit(graph("Graph1").activeLayer().curve(0), 2, 7)
f.fit()

An alternative way to initialize fit objects is to use directly a source data table instead of a plot curve:
f = LinearFit(table("Table1"), "xCol", "yCol", 2, 21) #from start row 2 to end row 21
f.fit()

It is possible to restrict the search range for any of the fit parameters:
f = NonLinearFit(graph("Graph1").activeLayer().curve(0))
f.setFormula("a0+a1*x+a2*x*x")
f.setParameterRange(parameterIndex, start, end)

All the settings of a non-linear fit can be saved to an XML file and restored later one, using this file, for a faster editing process.
Here’s for example how you can save the above fit function:
f.save("/fit_models/poly_fit.txt")

and how you can use this file during another fitting session, later on:
f = NonLinearFit(graph("Graph1").activeLayer(), "Table1_2")
f.load("/fit_models/poly_fit.txt")
f.fit()

If your script relies on a specific numbering of the fit parameters use setParameters() before setting the formula and switch of
automatic detection of the fit parameters when the fit formula is set:
f.setParameters("a2","a0","a1")
f.setFormula("a0+a1*x+a2*x*x",0)

After creating the Fit object and before calling its fit() method, you can set a number of parameters that influence the fit:
f.setDataFromTable(table("Table4"), "w", "energy", 10, 200, True) #change data source (last ←-
parameter enables/disables data sorting)
f.setDataFromCurve(curve) #change data source
f.setDataFromCurve(curveTitle, graph) #change data source
f.setDataFromCurve(curve, from, to) #change data source
f.setDataFromCurve(curveTitle, from, to, graph) #change data source
The QtiPlot Handbook 433 / 452

f.setInterval(from, to) #change data range


f.setInitialValue(number, value)
f.setInitialValues(value1, ...)
f.guessInitialValues()
f.setAlgorithm(algo) # algo = Fit.ScaledLevenbergMarquardt, Fit.UnscaledLevenbergMarquardt, ←-
Fit.NelderMeadSimplex
f.setWeightingData(method, colname) # method = Fit.NoWeighting, Fit.Instrumental, Fit. ←-
Statistical, Fit.Dataset, Fit.Direct
f.setTolerance(tolerance)
f.setMaximumIterations(number)
f.scaleErrors(yes = True)
f.setColor("green") #change the color of the result fit curve to green (default color ←-
is red)

After you’ve called fit(), you have a number of possibilities for extracting the results:
f.results()
f.errors()
f.residuals()
f.dataSize()
f.numParameters()
f.iterations()
f.status()
print(f.statusInfo(f.status()))
f.parametersTable("params")
f.covarianceMatrix("cov")

Writing the fit results to log is a time consuming operation and, especially when you need to perform a large number of fits, you
can disable/enable this functionality using:
setWriteFitResultsToLog(False) # the boolean parameter of this method is True by default

It is possible to customize the display of the fit results in terms of numerical format and precision:
f.setOutputFormat(’f’)
f.setOutputPrecision(2)

The value of the precision parameter for the setOutputPrecision() function has a different meaning depending on the
numeric format. The following format and precision options are available:

’g’ - Decimal or scientific e-notation, whichever is the most concise. The precision represents the maximum number of signifi-
cant figures in the output (trailing zeroes are omitted).

’f’ - Decimal notation. The precision represents the number of digits after the decimal point.
’e’ - Scientific e-notation where the letter e is used to represent "times ten raised to the power of" and is followed by the value
of the exponent. The precision represents the number of digits after the decimal point.

There are a number of statistical functions allowing you to test the goodness of the fit:
f.chiSquare()
f.rSquare()
f.adjustedRSquare()
f.rmse() # Root Mean Squared Error
f.rss() # Residual Sum of Squares

Also you can display confidence and prediction bands for the fit, based on a custom confidence level:
f.showPredictionLimits(0.95)
f.showConfidenceLimits(0.95)
The QtiPlot Handbook 434 / 452

It is possible to display both confidence and prediction bands with a single and more efficient function call, using the following
form:
f.showConfidenceLimits(0.95, True)

The data for both the confidence and prediction bands is stored in the same hidden table. You can interact with this table using
the following method:
t = f.confidenceBandsTable()

Alternatively, you can get pointers to the lower and upper confidence and prediction data curves, using the getter functions listed
bellow:
lcl = f.lclCurve()
ucl = f.uclCurve()
lpl = f.lplCurve()
upl = f.uplCurve()

Confidence limits for individual fit parameters can be calculated using:


f.lcl(parameterIndex, confidenceLevel)
f.ucl(parameterIndex, confidenceLevel)

where parameterIndex is a value between zero and f.numParameters() - 1.


It is important to know that QtiPlot can generate an analytical formula for the resulting fit curve or a normal plot curve with data
stored in a hidden table. You can choose either of these two output options, before calling the fit() instruction, using:
f.generateFunction(True, points=100)

If the first parameter of the above function is set to True, QtiPlot will generate an analytical function curve. If the points
parameter is not specified, by default the function will be estimated over 100 points. You can generate a table with the data points
of the result fit curve via a call to createTable():
t = f.createTable(False) # the table is hidden

If the first parameter of generateFunction() is set to False, QtiPlot will create a hidden data table containing the same number of
points as the data set/curve to be fitted (same abscissae). You can interact with this table and extract the data points of the result
fit curve using:
t = f.resultTable()

Some single peak fit functions (GaussFit, GaussAmpFit and LorentzFit) have a list of derived fit parameters that can be calculated
after the fit is performed. Bellow there’s a small script that demonstrates how to display these derived parameters in a new table:
f = GaussFit(graph("Graph1").activeLayer().curve(0))
f.guessInitialValues()
f.fit()

t = newTable(f.numDerivedParameters(), 3)
c1 = t.column(1)
c1.setName("Parameter")
c2 = t.column(2)
c2.setName("Function")
c3 = t.column(3)
c3.setName("Value")
for i in range(0, t.numRows()):
c1.setText(i, f.derivedParameterName(i))
c2.setText(i, f.derivedParameterFunction(i))
c3.setValue(i, f.derivedParameterValue(i))

t.resizeToShowAll()
The QtiPlot Handbook 435 / 452

7.2.16.11 Data Fit Example

In the example bellow a hidden table is generated and filled with data and a 2D plot window is created from this table. Afterwards
an exponential fit is performed on the displayed data curve:
rows = 100
t = newTable("test", rows, 3)
t.setHidden(True)
c1 = t.column(1)
c1.setName("time")
c2 = t.column(2)
c2.setName("data")
c3 = t.column(3)
c3.setName("weights")
c3.setPlotRole(Table.yErr)
c3.setNormalRandomValues()

for i in range (0, rows):


ti = i*40.0/(rows - 1.0)
yi = 1.5 + 5*exp(-0.1*ti) + 0.1*c3.value(i)
c1.setValue(i, ti)
c2.setValue(i, yi)
c3.setValue(i, 0.1*yi)

g = plot(t, ("test_data", "test_weights"), Layer.LineSymbols).activeLayer()

f = ExponentialFit(g.curve(0))
f.setWeightingData(Fit.Instrumental)
f.guessInitialValues()
f.setOutputPrecision(3)
f.fit()
f.showLegend()

7.2.16.12 Muliple Linear Regression

The script bellow performs a multiple linear regression analysis on a data table:
t = table("Book1")
independentData = ("A", "B", "C")
dependentData = "D"

mlr = MultiLinearRegression(t, independentData, dependentData)


mlr.setWeightingData(Fit.Instrumental, "E")
mlr.scaleErrors()
mlr.fit()

The following script performs a multiple linear regression with the intercept value fixed to 1.5. After the fit operation the script
also displays the plot of the fit residuals and information about the input data:
mlr = MultiLinearRegression(t, independentData, dependentData, True, 1.5)
mlr.fit()

# plot fit residuals


mlr.showResiduals()
mlr.showResidualsHistogram()
mlr.showResidualsVsIndependentData()

# plot predicted and input data values


mlr.showDependentDataVsIndex()
mlr.showDependentVsIndependentData()
The QtiPlot Handbook 436 / 452

#print information about the input data sets


print(mlr.inputDataInfo())

7.2.16.13 Integration

With the same assumptions as above, here’s how you can integrate a curve within a given interval:
integral = Integration(graph("Graph1").activeLayer().curve(0), 2, 10)
integral.run()
result = integral.area()

The script bellow shows how to perform an integration on a data set from a table:
i = Integration(table("Table1"), "Table_1", "Table_2", 3, 20, True)# sorted data range from ←-
row 3 to 20
i.enableGraphicsDisplay(False)
i.run()
result = i.area()

As you can see from the above examples, the numerical value of the integral can be obtained via the area() function.

7.2.16.14 Interpolation

The interpolation is used to generate a new data curve with a high number of points from an existing data set. Here’s an example:
interpolation = Interpolation(graph("Graph1").activeLayer().curve(0), 2, 10, Interpolation. ←-
Linear)
interpolation.setOutputPoints(10000)
interpolation.setColor("green")
interpolation.run()

The simplest interpolation method is the linear method. There are two other methods available: Interpolation.Akima and
Interpolation.Cubic. You can choose the interpolation method using:
interpolation.setMethod(Interpolation.Akima)

Please note that each of these methods require a minimum number of data points in the input curves which is 2, 3 and 5 respec-
tively. If the input curve has fewer data points you might experience a crash, therfore it is strongly advised to perform a check be-
fore initializing an Interpolation object. To this end you may use the function Interpolation.minimumDataSize(method):
print Interpolation.minimumDataSize(Interpolation.Linear)
print Interpolation.minimumDataSize(Interpolation.Cubic)
print Interpolation.minimumDataSize(Interpolation.Akima)

It is possible to evaluate the resulting spline at a certain x value:


print interpolation.evalAt(1.5)

The script bellow shows how to perform an interpolation on a data set from an existing table using all three available methods.
The script also creates a plot of the original data set together with the interpolated splines:
t = table("Table1") # existing source data table

rows = 600
t2 = newTable(rows, 4) # we create an output table
t2.setColName(1, "x")

interpol = Interpolation(t, "Table1_1", "Table1_2", Interpolation.Linear)


The QtiPlot Handbook 437 / 452

t2.setColName(2, interpol.objectName())

for i in range (1, rows + 1):


x = 1 + 0.05*i
t2.setCellData(1, i, x)
t2.setCellData(2, i, interpol.evalAt(x))

interpol.setMethod(Interpolation.Cubic)
t2.setColName(3, interpol.objectName())

for i in range (1, rows + 1):


t2.setCellData(3, i, interpol.evalAt(1 + 0.05*i))

interpol.setMethod(Interpolation.Akima)
t2.setColName(4, interpol.objectName())

for i in range (1, rows + 1):


t2.setCellData(4, i, interpol.evalAt(1 + 0.05*i))

g = qti.app.plot(t, 2, Layer.LineSymbols).activeLayer() # plot input data set


g.addCurves(t2, (2, 3, 4), Layer.Line) # add interpolated splines to the plot layer

7.2.16.15 Average multiple curves

The example bellow shows how to average two curves having different abscissas, using linear interpolations:
t1 = newTable("Table1", 100, 2)
c = t1.column(1)
c.setRowValues()
c = t1.column(2)
c.setCommand("sin(0.2*i)")
t1.recalculate(c.index())

t2 = newTable("Table2", 50, 2)
c = t2.column(1)
c.setCommand("2*i")
t2.recalculate(c.index())
c = t2.column(2)
c.setCommand("cos(0.2*i)")
t2.recalculate(c.index())

l = plot(t1, 2, Layer.LineSymbols).activeLayer()
c2 = l.insertCurve(t2, "Table2_2", Layer.LineSymbols)
c2.setPen(QPen(Qt.red))
c2.setSymbol(PlotSymbol(PlotSymbol.Rect, QBrush(Qt.red), QPen(Qt.red,1.5), QSize(7,7)))

interpol1 = Interpolation(l.curve(0), Interpolation.Linear)


interpol2 = Interpolation(c2, Interpolation.Linear)

rows = 1000
t3 = newTable("Table3", rows, 2)
t3.setColName(2, "Average")
for i in range (1, rows + 1):
x = 0.1*i
t3.setCellData(1, i, x)
t3.setCellData(2, i, 0.5*(interpol1.evalAt(x) + interpol2.evalAt(x)))

c3 = l.insertCurve(t3, "Table3_Average", Layer.Line)


c3.setPen(QPen(Qt.green, 2))
The QtiPlot Handbook 438 / 452

7.2.16.16 Smoothing

Assuming you have a graph named Graph1 with an irregular curve entitled Table1_2 (on its active layer). You can smooth
this curve using a SmoothFilter:
smooth = SmoothFilter(graph("Graph1").activeLayer().curve(0), SmoothFilter.Average)
smooth.setSmoothPoints(10)
smooth.run()

The default smoothing method is the mowing window average. Other smoothing methods are the SmoothFilter.FFT,
SmoothFilter.Lowess and SmoothFilter.SavitzkyGolay. Here’s an example of how to use the last two methods:
smooth.setMethod(SmoothFilter.Lowess)
smooth.setLowessParameter(0.2, 2)
smooth.run()

smooth.setSmoothPoints(5,5)
smooth.setMethod(SmoothFilter.SavitzkyGolay)
smooth.setPolynomOrder(9)
smooth.run()

7.2.16.17 Find Peaks

A FindPeaksFilter can be used to search the positions of the peaks in a data curve. Assuming you have an input data table named
Table1, containing two columns, the following script demonstrates the usage of this type of filter:
g = qti.app.plot(table("Table1"), 2, Layer.Line).activeLayer() # plot input data set

f = FindPeaksFilter(g.curve(0))
f.setPeakFindingAlgorithm(FindPeaksFilter.FirstDerivative)
f.setDirection(FindPeaksFilter.Negative) # only search for negative peaks (local minima)

# smooth the 1st derivative before performing the search


f.setMethod(SmoothFilter.Average)
f.setSmoothPoints(3)

f.setThreshold(15) # set the detection threshold in percentages

f.setRecalculateMode(Filter.AutoRecalculate)
f.enableGraphicsDisplay(True, g)
f.run()

c = f.resultCurve()
c.setLineStyle(PlotCurve.Sticks)

g.addFilter(f)

#print the results


for i in range (0, f.peakCount()):
print f.center(i), f.height(i)

From the example above you may notice that it is possible to smooth the input curve using the data smoothing methods described
in the previous section (Smoothing) before performing the actual search for the local extrema.
The available algorithms for searching the peaks are: FindPeaksFilter.QuickSearch and FindPeaksFilter.FirstDeriv
A detection threshold for the local extrema can be set using the setThreshold function and represents a percentage of the
difference between the maximum and minimum values of the input data. The default value is 10 %.
The QtiPlot Handbook 439 / 452

7.2.17 Statistics

7.2.17.1 Descriptive Statistics

stats = Statistics("Table1_2", 0, 20, True) # sorted data range


stats.run()

print "N = %d" % stats.dataSize()


print "Degrees of freedom = %d" % stats.dof()
print "Sorted = ", stats.hasSortedData()
print "Minimum = %f" % stats.minValue()
print "Maximum = %f" % stats.maxValue()
print "Mean = %f" % stats.mean()
print "Median = %f" % stats.median()
print "Q1 (1st quartile) = %f" % stats.q1()
print "Q3 (3rd quartile) = %f" % stats.q3()
print "Interquartile range (Q3 - Q1) = %f" % stats.iqr()
print "D1 (1st decile) = %f" % stats.quantile(0.1)
print "D9 (9th decile) = %f" % stats.quantile(0.9)
print "Variance = %f" % stats.variance()
print "Standard Deviation = %f" % stats.standardDeviation()
print "Standard Error = %f" % stats.standardError()
print "Kurtosis = %f" % stats.kurtosis()
print "Skewness = %f" % stats.skewness()

For all the statistic tests below, once you have created a test object, you can use the following methods:
test.showResultsLog(False) # disable the logging of the results
test.showDescriptiveStatistics(False) # disable the display of the descriptive statistics ←-
results
test.run()

print test.statistic()
print test.pValue()
print test.testValue()
print test.tail()
print test.logInfo()

t = test.resultTable("MyResultTable") # Returns a pointer to the table created to display ←-


the results (the table name is optional)

If the statistic test is performed on two datasets (samples), it is possible to get a reference to the Statistics object corresponding
to the second sample:
s2 = test.sample2()
print s2.colName()
print s2.dataSize()

7.2.17.2 Hypothesis Testing - Student’s t-Test

test = tTest(15.2, 0.05, "Table1_2") # One sample test, test mean = 15.2, significance ←-
level = 0.05
test.run()

test.setTestValue(15.0)
test.setSignificanceLevel(0.5)
test.setTail(StatisticTest.Left) # or StatisticTest.Right, or StatisticTest.Both (default ←-
value)
test.run()
The QtiPlot Handbook 440 / 452

print test.t() # same as test.statistic()


print test.dof() # degrees of freedom
print test.power(0.5)
print test.power(0.5, 50) # alternative sample size = 50
print test.pValue()
print test.lcl(90) # lower confidence limit for mean
print test.ucl(90) # upper confidence limit for mean

test = tTest(15.2, 0.05, "Table1_1", "Table1_2", True) # Two sample paired test
print test.logInfo()

test = tTest(15.2, 0.05, "Table1_1", "Table1_2") # Two sample independent test


test.run()

test.setSample1("Table2_1")
test.setSample2("Table3_2", True) # Two sample paired test
test.run()

7.2.17.3 One Sample Test for Variance (Chi-Square Test)

test = ChiSquareTest(88.2, 0.05, "Table1_2") # Test variance = 88.2, significance level = ←-


0.05
test.run()

print test.chiSquare() # same as test.statistic()


print test.pValue()
print test.logInfo()

7.2.17.4 Two Sample Kolmogorov-Smirnov Test

test = KolmogorovSmirnovTest("Book1_B", "Book1_C")


test.setSignificanceLevel(0.01)
test.run()

print test.statistic()
print test.pValue() # probability
print test.logInfo()

7.2.17.5 Kruskal-Wallis Anova

test = KruskalWallisAnova([’Table1_1’, ’Table2_2’, ’Table3_3’])


test.run()

print test.statistic()
print test.pValue()

7.2.17.6 Kruskal-Wallis Anova

test = KruskalWallisAnova([’Table1_1’, ’Table2_2’, ’Table3_3’])# or


# test = KruskalWallisAnova(table("Table1").columns()) # add all table columns to the test
test.run()

print test.statistic()
print test.pValue()
The QtiPlot Handbook 441 / 452

7.2.17.7 Mood’s Median Test

test = MoodsMedianTest([’Table1_1’, ’Table2_2’, ’Table3_3’]) # or


# test = MoodsMedianTest(table("Table1").columns(Table.Y)) # run test on all Y columns in " ←-
Table1"
test.run()

print test.statistic()
print test.pValue()
print test.testMedian() # median of combined samples

7.2.17.8 Mann-Whitney Test

test = MannWhitneyTest("Book1_B", "Book1_C")


test.run()

print test.statistic()
print test.pValue()
print test.logInfo()

7.2.17.9 One Sample Wilcoxon Signed Rank Test

test = WilcoxonTest("Table_1")
test.setTestValue(3.7) # set test median
test.setTail(StatisticTest.Left) # perform a lower-tailed test
test.run()
print test.statistic() # W
print test.zValue() # Z
print test.pValue() # exact probability
print test.normalPValue() # approx. probability

7.2.17.10 Paired Sample Wilcoxon Signed Rank Test

test = WilcoxonTest("Table1_1", "Table1_2")


test.setTail(StatisticTest.Right) # perform an upper-tailed test
test.run()
print test.statistic() # W
print test.zValue() # Z
print test.pValue() # exact probability
print test.normalPValue() # approx. probability
print test.ties() # the number of equal values
print test.reducedDataSize() # sample size - ties
print test.negativeRanks() # the number of negative ranks
print test.statistic() - test.negativeRanks() # the number of positive ranks

7.2.17.11 Sign Test

test = SignTest("Table1_A", "Table1_B")


test.setTail(StatisticTest.Right) # perform an upper-tailed test
test.run()
print test.statistic() # number of positive differences
print test.zValue()
print test.pValue() # probability
print test.ties() # number of equal values
print test.reducedDataSize() # sample size - ties
The QtiPlot Handbook 442 / 452

7.2.17.12 Normality Test (Shapiro - Wilk)

test = ShapiroWilkTest("Table3_1")
test.setSignificanceLevel(0.1)
test.run()

print test.w() # same as test.statistic()


print test.pValue()
print test.logInfo()

7.2.17.13 One-Way ANOVA

test = Anova()
test.setSignificanceLevel(0.1) # default level is 0.05
test.addSample("Table1_1")
test.addSample("Table1_2")
test.addSample("Table1_3")
test.enablePostHocTest(Anova.Tukey | Anova.Bonferroni)
test.enablePostHocTestTables(True) # generate result tables
test.run()
t1 = test.posthocTestTable(Anova.Tukey)
t1.show()
t2 = test.posthocTestTable(Anova.Bonferroni)
t2.show()
print test.fStat() # F statistic = ssm/sse (same as test.statistic())
print test.pValue()
print test.ssm() # "between-group" sum of squares
print test.sse() # "within-group" sum of squares
print test.sst() # total sum of squares

test.showDescriptiveStatistics(False)
print test.logInfo()

The folowing post-hoc tests are currently implemented in QtiPlot: Anova.Tukey, Anova.Bonferroni, Anova.Sidak, Anova.Fisher,
Anova.Scheffe, Anova.HolmBonferroni and Anova.HolmSidak.

7.2.17.14 Two-Way ANOVA

test = Anova(True)
test.addSample("Table1_1", 1, 1) # Level factor A = 1, level factor B = 1
test.addSample("Table1_2", 1, 2) # Level factor A = 1, level factor B = 2
test.addSample("Table1_3", 2, 1) # Level factor A = 2, level factor B = 1
test.addSample("Table1_4", 2, 2) # Level factor A = 2, level factor B = 2
test.setAnovaTwoWayModel(2) # Fixed model = 0, Random model = 1, Mixed model = 2
test.enablePostHocTest(Anova.Tukey | Anova.Bonferroni | Anova.Fisher)
test.enablePostHocTestTables(True) # generate result tables
test.enableInteractions(False) # Disable calculation of interaction between factors
test.run()

test.posthocTestTable(Anova.Tukey).show()
test.posthocTestTable(Anova.Bonferroni).show()
test.posthocTestTable(Anova.Fisher).show()

print test.fStatA() # F statistic for factor A


print test.fStatB() # F statistic for factor B
print test.fStatAB() # F statistic for the interaction
print test.fStatModel() # F statistic for the model
print test.pValueA() # P value for factor A
The QtiPlot Handbook 443 / 452

print test.pValueB() # P value for factor B


print test.pValueAB() # P value for the interaction
print test.pValueModel() # P value for the model
print test.ssa() # sum of squares for factor A
print test.ssb() # sum of squares for factor B
print test.ssab() # sum of squares for the interaction
print test.ssm() # sum of squares for the model
print test.msa() # mean square value for factor A
print test.msb() # mean square value for factor B
print test.msab() # mean square value for the interaction
print test.msm() # mean square value for the model

print test.logInfo()

The folowing post-hoc tests are currently implemented in QtiPlot: Anova.Tukey, Anova.Bonferroni, Anova.Sidak, Anova.Fisher,
Anova.Scheffe, Anova.HolmBonferroni and Anova.HolmSidak.

7.2.18 Working with Notes

The following functions are available when dealing with multi-tab notes:
setAutoexec(on = True)

text()
setText(text)

exportPDF(fileName)
saveAs(fileName)
importASCII(fileName)

showLineNumbers(on = True)

setFont(QFont f)
setTabStopWidth(int length)

tabs()
addTab()
removeTab(tabIndex)
renameTab(tabIndex, title)

e = editor(int index)
e = currentEditor()

It is possible to trigger the execution of a script in a Notes window tab:


e = note("Notes1").currentEditor()
e.executeAll()
# Check if the script is still running:
print e.isRunning()

It is also possible to program a script to be run periodically:


e = note("Notes1").currentEditor()
e.executePeriodically(3.5) # running interval is set to 3.5 seconds
print e.isRunningPeriodically() # should print True
print e.runningInterval() # should print 3.5

In order to stop the periodic execution of a script you may use:


note("Notes1").currentEditor().stopPeriodicExecution()
The QtiPlot Handbook 444 / 452

7.2.19 Using PyQt’s dialogs and classes

Let’s assume that you have a lot of ASCII data files to analyze. Furthermore, let’s suppose that these files were created during
several series of measurements, each measurement generating a set of files identified by a certain string in the file name, like for
example: "disper1". In order to analyze these files, you need first of all to import them into tables. The following code snippet
shows how to automate this task using PyQt dialogs and convenience classes:
# Pop-up a file dialog allowing to chose the working folder:
dirPath = QFileDialog.getExistingDirectory(qti.app, "Choose Working Folder", "/test/")
# Create a folder object using Qt’s QDir class:
folder = QDir(dirPath)
# Pop-up a text input dialog allowing to chose the file naming pattern:
namePattern,ok = QInputDialog.getText(qti.app,"Pattern","Text:",QLineEdit.Normal,"disper1")
if ok: # get the list of file names in the working directory containing the above pattern
fileNames = folder.entryList(["*" + namePattern + "*.dat"])
for i in range (0, len(fileNames)): # import each file into a new project table
newTable().importASCII(dirPath + "/" + fileNames[i],";")

For a detailed description of all the dialogs and utility classes provided by Qt/PyQt please take a look at the PyQt documentation.

7.2.20 Using Qt Designer for easy creation of custom user dialogs

Writing and designing user dialogs can be a very complicated task. The QtDesigner application provided by the Qt framework
makes it easy and very pleasant. It allows you to design widgets, dialogs or complete main windows using on-screen forms and
a simple drag-and-drop interface. Qt Designer uses XML .ui files to store designs. Once you have finished the design process
you can load and use an .ui file in your Python scripts with the help of the uic module.
As an example, suppose that we have created a test dialog containing an input QDoubleSpinBox called "valueBox" and a QPush-
Button called "okButton". On pressing this button, we would like to create a new table displaying the input value in its first cell.
We have saved this dialog to a file called "myDialog.ui". A minimalistic approach is shown in the small script below:
def createTable():
t = newTable()
t.setCell(1, 1, ui.valueBox.value())

ui = uic.loadUi("myDialog.ui")
ui.okButton.clicked.connect(createTable)
ui.show()

Once you understand how to create a custom dialog using the basic controls provided by Qt you can get rid of the Qt Designer
tool. For example, here’s how you create from scratch, in Python, the above "myDialog.ui" form:
class myDialog:
def __init__(self):
d = QDialog(qti.app)
d.setWindowTitle("myDialog")
grid = QHBoxLayout(d)

self.valueBox = QDoubleSpinBox()
grid.addWidget(self.valueBox)

self.okButton = QPushButton("OK")
self.okButton.clicked.connect(self.createTable)
grid.addWidget(self.okButton)

d.show()

def createTable(self):
t = newTable()
t.setCell(1, 1, self.valueBox.value())
The QtiPlot Handbook 445 / 452

dialog = myDialog()

For more details about how to use .ui files in your Python scripts please read the PyQt documentation.

7.2.21 Task automation example

Below you can find a detailed example showing how to completely automatize tasks in QtiPlot. It can be used in order to verify
the accuracy of the curve fitting algorithms in QtiPlot. The test data files that must be used with this example were retrieved
from the Statistical Reference Datasets Project of the National Institute of Standards and Technology (NIST). In order to run this
example, you first need to download und unzip the nonlinear regression test files from the QtiPlot website.
Please note that the script can be used as it is only if QtiPlot was built using the Qt 5 library.
import sys

# Pop-up a file dialog allowing to chose the data folder:


dirPath = QFileDialog.getExistingDirectory(qti.app, "Choose Strd-NIST Data Folder")

saveout = sys.stdout # backup default option for sys.stdout

# create a log file in the data folder


resultsPath = dirPath + "/" + "results.txt"
fsock = open(resultsPath, "w")
sys.stdout = fsock

# make sure that the decimal separator is the dot character


qti.app.setLocale(QtCore.QLocale.c())

# Create a folder object using Qt’s QDir class:


folder = QDir(dirPath)
# get the list of *.dat files from the data folder
files = folder.entryList(["*.dat"])
count = len(files)
for i in range (0, count):
name = files[i]
path = dirPath + "/" + name
print(str(i + 1) + ") Parsing data file: " + path + " ...")

file = QFile(path)
if file.open(QIODevice.ReadOnly):
ts = QTextStream(file)
name = name.replace(".dat", "")
changeFolder(addFolder(name)) #create a new folder and move to it
formula = ""
parameters = 0
initValues = list()
certifiedValues = list()
standardDevValues = list()
xLabel = "X"
yLabel = "Y"

while (ts.atEnd() == False):


s = ts.readLine().strip()

if (s.count("(y = ")):
lst = s.split("=")
yLabel = lst[1].replace(")", "")

if (s.count("(x = ")):
lst = s.split("=")
The QtiPlot Handbook 446 / 452

xLabel = lst[1].replace(")", "")

if (s.count("Model:")):
s = ts.readLine().strip()
lst = s.split()
s = lst[0]
parameters = int(s)

ts.readLine()
if (name == "Roszman1"):
ts.readLine()
formula = ts.readLine().strip()
else:
formula = (ts.readLine() + ts.readLine() + ts.readLine()).strip()

lst = formula.split(" = ")


formula = lst[1].strip()
formula = formula.replace("**", "^")
formula = formula.replace("arctan", "atan")
formula = formula.replace("[", "(")
formula = formula.replace("]", ")")
formula = formula.replace(" + e", "")

if (s.count("Starting")):
ts.readLine()
ts.readLine()
for i in range (1, parameters + 1):
s = ts.readLine().strip()
lst = s.split(" = ")
s = lst[1].strip()
lst = s.split()
initValues.append(float(lst[1]))
certifiedValues.append(lst[2])
standardDevValues.append(lst[3])

if (s.count("Data:") and s.count("y") and s.endswith("x")):


row = 0
t = newTable(name, 300, 2)
t.setColName(1, "x")
t.setColName(2, "y")
while (ts.atEnd() == False):
row = row + 1
s = ts.readLine().strip()
lst = s.split()
t.setText(1, row, lst[1])
t.setText(2, row, lst[0])

g = plot(t, t.colName(2), Layer.Scatter).activeLayer()


g.setTitle("Data set: " + name + ".dat")
g.setAxisTitle(Layer.Bottom, xLabel)
g.setAxisTitle(Layer.Left, yLabel)

f = NonLinearFit(g.curve(0))
f.setObjectName(name)
f.setFormula(formula)
f.scaleErrors()
for i in range (0, parameters):
f.setInitialValue(i, initValues[i])

f.fit()
print("\nQtiPlot Results:\n")
print("Table: " + t.objectName())
The QtiPlot Handbook 447 / 452

print(f.legendInfo().replace("<b>", "").replace("</b>", ""))

print("\nCertified Values:")

paramNames = f.parameterNames()
for i in range (0, parameters):
print(’%s = %s +/- %s’ % (paramNames[i], certifiedValues[i], standardDevValues[i ←-
]))

print("\nDifference with QtiPlot results:")


results = f.results()
for i in range (0, parameters):
diff = fabs(results[i] - float(certifiedValues[i]))
print(’db%d = %6E’ % (i+1, diff))
print("\n")

file.close()
changeFolder(rootFolder())

print("Done parsing " + str(count) + " files.\n")


fsock.close()# close output results file
sys.stdout = saveout # restore initial sys.stdout

resNote = newNote("ResultsLog")
resNote.importASCII(resultsPath)
resNote.showMaximized()

saveProjectAs(dirPath + "/" + "StRD_NIST.qti")

7.2.22 Scope Changes

In recent versions the scope rules were changed to match standard Python:

• The keyword "global" refers to the module, e.g. a particular script window or column script. Outside of any function, this is the
default namespace, so "global x" has no effect. Inside a function, "global x" refers to x in the module namespace. Previously,
"global" referred to QtiPlot’s global variables, and module-level variables were inaccessible from inside a function, unless
marked global.
• To read and write QtiPlot’s global variables, use the new special variable globals:
globals.myvar = 5
print globals.myvar

globals is shared among all modules.

If a script has any "global" declaration outside of a function, QtiPlot uses the old scope rules. Existing scripts should keep
working, but for best results, update your scripts:

• If a "global" variable x is used only within one script, delete any "global x" that is outside of a function.
• If a "global" variable needs to be accessed outside the script that defined it, change
global x
x = 5

to
globals.x = 5

and replace all references to x with globals.x


The QtiPlot Handbook 448 / 452

7.2.23 QtiPlot/Python API

The complete QtiPlot/Python API can be consulted here.

7.2.24 PyQt Class Reference

The complete PyQt class reference can be consulted here.


The QtiPlot Handbook 449 / 452

Chapter 8

Acknowledgements

QtiPlot includes MPFIT , software developed by the University of Chicago, as Operator of Argonne National Laboratory.

8.1 MPFIT: A MINPACK-1 Least Squares Fitting Library in C

Original public domain version by B. Garbow, K. Hillstrom, J. More’ (Argonne National Laboratory, MINPACK project, March
1980) Copyright (1999) University of Chicago(see below).
Tranlation to C Language by S. Moshier (moshier.net) (no restrictions placed on distribution).
Enhancements and packaging by C. Markwardt (comparable to IDL fitting routine MPFIT see http://cow.physics.wisc.edu/~craigm/idl/id
Copyright (C) 2003, 2004, 2006, 2007 Craig B. Markwardt
This software is provided as is without any warranty whatsoever. Permission to use, copy, modify, and distribute modified or
unmodified copies is granted, provided this copyright and disclaimer are included unchanged.

8.1.1 Minpack Copyright Notice (1999) University of Chicago. All rights reserved

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment:
"This product includes software developed by the University of Chicago, as Operator of Argonne National Laboratory."
Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally
appear.
4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. THE
COPYRIGHT HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EM-
PLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IM-
PLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT,
(2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT IN-
FRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTER-
RUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.
5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDER, THE UNITED STATES, THE UNITED
STATES DEPARTMENT OF ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CON-
SEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO
The QtiPlot Handbook 450 / 452

LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS AS-
SERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHER-
WISE, EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.
The QtiPlot Handbook 451 / 452

Chapter 9

Frequently asked questions

Q: How can I visualise data from a text file?


A: Go to the File menu and select the Import -> Import ASCII... command.
Q: How can I plot data from a table (worksheet)?
A: Click on the table header to choose the columns to plot and then right click. Chose the ’Plot’ option from the pop-up menu
and then the type of plot you want.You can also use the plot assistant: press ’CTRL+ALT+W’ keys to show it, or go to ’View’
menu -> ’Plot wizard’.
Q: How can I export a plot to an image format?
A: Right click in the plot window and chose the ’Export’ option.
Q: Can I export transparent images?
A: Yes, ".png" images have transparent background. See the Export Graph -> Current command.
Q: How can I export a text file?
A: Go to the File menu and select the Export ASCII dialog.
Q: How can I choose a window using the project explorer?
A: Double click on the window name will show the window maximized, even if it was hidden before.
Q: How can I choose the data range from a plot curve, when doing a curve fit?
A: Go to the Data menu and use the Select Data Range command. Click in the plot window and use the ’Up’ and ’Down’ arrows
keys to select the curve to analyse. Keeping ’CTRL’ button and ’Left’ or ’Right’ arrow keys simultaneousely pressed permit to
move the selected cursor and consequently to modify the data range.
Q: Can I fit a plot curve using my own function?
A: Go to the Analysis menu and select the The Fit Wizard... command. Define the function (myFunction=...), enter the initial
guesses for the parameters, choose the fitting range and the number of iterations and click ’OK’
Q: How can I visualize a pixel line profile from an image?
A: Right click on the image you want to analyse and select the option ’View pixel line profile’ from the popup menu. A dialog
window opens and allows you to select the number of pixels used for the analysis. Choose a value and click "OK". Then click
on the image to select the start point and move your mouse to select an end point while keeping the left button pressed. When
you release the left button a plot window appears, representing the pixel intensity versus pixel index.
Q: How can I make a graph that has one x-axis, but two y-axes with different orders of magnitude?
A: Select at least two columns that you want to display and use the Double-Y.
The QtiPlot Handbook 452 / 452

Chapter 10

Index

E
Excel, 4, 6

G
graph, 4

M
matrix, 4, 8, 273–275

T
table, 4, 5, 272, 273, 310, 311

You might also like