Labplot 2
Labplot 2
Labplot 2
Stefan Gerlach
Alexander Semke
Yuri Chornoivan
Garvit Khatri
The LabPlot Handbook
2
Contents
1 Introduction 6
2 Using LabPlot 7
2.1 Interface Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Project Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Main Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Properties Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Spreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.8 Worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.9 CAS Worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.10 File Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11 Datapicker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.12 Import Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.13 Export Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3 Command Reference 21
3.1 The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 The Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3 The Worksheet Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4 The Spreadsheet Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.5 The CAS Worksheet Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.6 The Datapicker Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.7 The Settings Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.8 The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.9 Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4 Plotting 24
4.1 Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Legends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The LabPlot Handbook
5 Analysis functions 25
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.2 Data reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3 Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.4 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.6 Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.7 Curve fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.8 Fourier filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.9 Fourier transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6 Curve Tracing 29
6.1 Upload Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.3 Axis Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.4 Datapicker Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.5 Curve Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7 Advanced Topics 31
7.1 Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.1.1 Error bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.1.2 TeX label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
8 Short Tutorials 32
8.1 Building a sine graph with LabPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.2 Building a graph from spreadsheet data with LabPlot . . . . . . . . . . . . . . . . . 37
9 Examples 43
9.1 2D Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.2 Signal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.3 Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.4 Import/Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
9.5 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10 Parser functions 45
10.1 Standard functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.2 Trigonometric functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.3 Special functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.4 Random number distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.5 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.6 GSL constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
12 License 62
4
Abstract
Chapter 1
Introduction
LabPlot is a KDE application for interactive graphing and analysis of scientific data. LabPlot
provides an easy way to create, manage and edit plots.
Features:
• Project-based management of data
• Project-explorer for management and organization of created objects in different folders and
sub-folders
• Spreadsheet with basic functionality for manual data entry or for generation of uniform and
non-uniform random numbers
• Import of external ASCII-data into the project for further editing and visualization
• Export of spreadsheet to an ASCII-file
• Worksheet as the main parent object for plots, labels etc., supports different layouts and zoom-
ing functions
• Export of worksheet to different formats (pdf, eps, png and svg)
• Great variety of editing capabilities for properties of worksheet and its objects
• Cartesian plots, created either from imported or manually created data sets or via mathemati-
cal equation
• Definition of mathematical formulas is supported by syntax-highlighting and completion and
by the list of thematicaly grouped mathematical and physical constants and functions
• Investigation of plotted data is supported by many zooming and navigation features
• Several analysis functions and methods for data reduction, differentiation, integration, inter-
polation, smoothing, (nonlinear) fitting, Fourier filter and Fourier transform
• Linear and non-linear fits to data, several fit-models are predefined and custom models with
arbitrary number of parameters can be provided
• Supports many CAS backends like Maxima, Python, KAlgebra, Sage
• Nice Worksheet view for evaluating expressions
• Easy plugin based structure to add different Backends
• Plugin based assistant dialogs for common tasks (like integrating a function or entering a ma-
trix)
• Datapicker for manual or (semi-)automatic data extraction from imported images containing
plots and curves.
LabPlot can be found on its homepage at kde.org: https://labplot.kde.org/ .
6
The LabPlot Handbook
Chapter 2
Using LabPlot
7
The LabPlot Handbook
Project explorer is a dockable window and can be placed at an arbitrary place. The user can
determine which columns should be shown by selecting/deselecting the columns of interest in
the context menu (right mouse button click on an empty place in the tree-view or its header).
Furthermore, the list of shown objects can be reduced by providing a filter in the Search/Filter
text field.
When sub-windows are used, all windows of objects belonging to the currently selected folder
only are shown. Alternatively, the visibility of windows can be extended to the currently selected
folder and its sub-folders or to all windows in the project. This behaviour is controlled via the
parameter ˝Window visibility policy˝ accessible via the context menu of the project explorer.
8
The LabPlot Handbook
2.5 Spreadsheet
The spreadsheet is the main part of LabPlot when working with data and consists of columns.
Column is the basic data set in LabPlot used for plotting and data analysis. Every column of the
spreadsheet is specified by its name and the type - numeric, text, month names, day names and
date and time. Also, for each type different representation formats can be assigned like decimal
or scientific format for numeric columns etc.
You can mask selected data points in the spreadsheet (Selection → Mask Selection from the
spreadsheet cell context menu). Masked data is not plotted and is also excluded from data anal-
ysis functions like fitting etc. Alternatively, you can mask or drop values in a column (Mask
Values or Drop Values from the column context menu) by specifying a range. When specifying
which values to mask or to drop, several operators (“equal to”, “greater than”, “lesser than”, etc.)
are available. These operations can help to hide or to remove some outliers in the data set prior
to, e.g., performing a fit to this data set.
Any spreadsheet function can be reached via the context menu (right mouse button click). You
can cut, copy and paste between spreadsheets, generate, normalize and sort data and finally
make plots out of your data.
New data can be produced either by entering it manually in the spreadsheet or by generating the
data according to a certain prescription. LabPlot provides 5 different methods to generate data,
accessible via the context menu of the column:
• Row Numbers - values in the column are set according to its row number, this provide an easy
way to quickly create an index.
• Const Values - values in the column are set to a constant value provided by the user.
• Equidistant values (for numeric columns only) - given the minimal and the maximal values,
the equidistant values can be either generated by fixing the total number of values in that range
or by fixing the increment (distance).
9
The LabPlot Handbook
• Random values (for numeric columns only) - values are randomly generated according to
the selected distribution. To generate uniformly distributed random numbers, select ˝Flat˝
distribution.
In the simplest cases a non-uniform distribution is calculated analytically from the uniform
distribution of a random number generator by applying an appropriate transformation. More
complicated distributions are created by the acceptance-rejection method, which compares the
desired distribution against a distribution which is similar and known analytically.
• Function values (for numeric columns only) - values are generated according to a mathematical
function provided by the user, a column (data set) containing the function arguments has to be
provided. It is possible to define a multivariant function and to provide a data set (a column
in a spreadsheet) for each of the variables. The corresponding dialog supports the creation of
arbitrary number of variables.
10
The LabPlot Handbook
Already existing data can be imported into a spreadsheet from external files via the ˝Import
Data˝ dialog. Imported data will be stored in the project file. Changes on data, performed either
in the spreadsheet or in the external file after the import, are not synchronized anymore.
The data in the spreadsheet can be exported to an external file (see Export Dialog).
2.6 Matrix
Matrix is another container for matrix-like data. This container is presented like a table or, al-
ternatively, as a two-dimensional greyscale image. The elements of such a table/matrix can be
thought as being the Z-values, Z=Z(X,Y), with X and Y values being the row and column num-
bers, respectively. The transition from the row and column numbers to the logical coordinates is
done via an explicit user-defined mapping of both representations.
The matrix data can either be entered manually or via an import from an external file. Similar to
the data generation for a column in a spreadsheet, the matrix can be filled with constant values
or via a formula, too. The screenshot below shows the image view of a matrix together with the
formula that was used to generate the matrix elements:
11
The LabPlot Handbook
2.7 Workbook
Workbook helps the user to better organize and to group different data containers (Spreadsheet
and Matrix). This object serves as the parent container for multiple Spreadsheet- and/or Matrix-
objects and puts them together in a view with multiple tabs:
With folders it is already possible to bring some structure in the Project Explorer and to group
together several related objects (spreadsheets with data stemming from text files of similar ori-
gin, red, green and blue values of an image imported into three different matrices, etc.). With
Workbook the user has the possibility for another additional grouping.
2.8 Worksheet
The worksheet is, besides the data containers Spreadsheet and Matrix, another central part of the
application and provides an area for showing and grouping together different kinds of worksheet
objects - plots, labels etc.
12
The LabPlot Handbook
Worksheets can either have a fixed size (a user defined size or one of the predefined sizes like A4,
Letter etc.) or they can fill out the complete available area for the worksheet window. Multiple
plots can be arranged on the worksheet in a vertical, horizontal or grid layouts.
Many properties of the worksheet like size, background colour and layout settings can be
changed in the ˝Worksheet properties˝ pane.
Different worksheet actions dealing with the creation of new objects, changing of the current
mouse mode or zooming can be accessed via the toolbar, main menu or the context menu of the
worksheet in the project explorer.
The results shown on the worksheet can be exported to different formats via the export dialog.
13
The LabPlot Handbook
Sage:
Sage is a free open-source mathematics software system licensed under the GPL. It com-
bines the power of many existing open-source packages, within a common Python-based
interface. See http://sagemath.org for more information.
Maxima:
Maxima is a system for the manipulation of symbolic and numeric expressions, including
differentiation, integration, Taylor series, Laplace transforms, ordinary differential equa-
tions, systems of linear equations, polynomials, sets, lists, vectors, matrices, and tensors.
Maxima yields high-precision numeric results by using exact fractions, arbitrary precision
integers, and variable precision floating point numbers. Maxima can plot functions and
data in two and three dimensions. See http://maxima.sourceforge.net for more informa-
tion.
R:
R is a language and environment for statistical computing and graphics, similar to the S
language and environment. It provides a wide variety of statistical (linear and nonlinear
modelling, classical statistical tests, time-series analysis, classification, clustering, ...) and
graphical techniques, and is highly extensible. The S language is often the vehicle of choice
for research in statistical methodology, and R provides an open-source route to this. See
http://www.r-project.org for more information.
KAlgebra:
KAlgebra is a MathML-based graph calculator, that ships with KDE Education project. See
http://edu.kde.org/kalgebra/ for more information.
Qalculate!:
Qalculate! is not your regular software replication of the cheapest available calculator. Qal-
culate! aims to make full use of the superior interface, power and flexibility of modern
computers. The center of attention in Qalculate! is the expression entry. Instead of entering
each number in a mathematical expression separately, you can directly write the whole ex-
pression and later modify it. The interpretation of expressions is flexible and fault tolerant,
14
The LabPlot Handbook
and if you nevertheless do something wrong, Qalculate! will tell you so. Not fully solvable
expressions are however not errors. Qalculate! will simplify as far as it can and answer with
an expression. In addition to numbers and arithmetic operators, an expression may contain
any combination of variables, units, and functions. See http://qalculate.sourceforge.net/
for more information.
Python2:
Python is a remarkably powerful dynamic programming language that is used in a wide
variety of application domains. There are several Python packages to scientific program-
ming.
Python is distributed under Python Software Foundation license (GPL compatible). See the
official website for more information.
N OTE
This backend adds an additional item to the Cantor’s main menu, Package. The only item of this
menu is Package → Import Package. This item can be used to import Python packages to the
worksheet.
WARNING
This backend supports Python 2 only.
Scilab:
Scilab is an free software, cross-platform numerical computational package and a high-
level, numerically oriented programming language.
Scilab is distributed under CeCILL license (GPL compatible). See http://www.scilab.org/
for more information.
WARNING
You need Scilab version 5.5 or higher to be installed in your system to make this backend usable.
Octave:
GNU Octave is a high-level language, primarily intended for numerical computations. It
provides a convenient command line interface for solving linear and nonlinear problems
numerically, and for performing other numerical experiments using a language that is
mostly compatible with MATLAB. See http://www.gnu.org/software/octave/ for more
information.
Lua:
Lua is a fast and lightweight scripting language, with a simple procedural syntax. There
are several libraries in Lua aimed at math and science.
See http://www.lua.org/ for more information.
This backend supports luajit 2.
15
The LabPlot Handbook
Since no spreadsheet has to be filled with the imported data, the import into a file data source is
faster than into a spreadsheet which can be advantageously when dealing with big files.
It is possible to store the link to the external file in the project file only and not its content. Each
time the project file is opened in LabPlot, the content is read from the external file again. Also, it
is possible to let LabPlot watch the file for changes - the content of the file data source is updated
if the external file was changed.
The additional options determining the import of the data are equivalent to those provided in
Import Dialog.
2.11 Datapicker
Datapicker is a tool that allows you to easily extract data from image files. The process of extrac-
tion consists mainly out of the following steps:
• Import an image containing plots and curves where you want to read the data points from.
• Select the plot type (cartesian, polar, etc.).
• Select tree reference points and provide values for them. With the help of these points the
logical coordinate system is determined.
• Create a new datapicker curve and set the type of the error bars.
• Switch to the mouse mode ˝Set Curve Points˝ and start selecting points on the imported image
- the coordinates for the selected points are determined and added to the spreadsheet ˝Data˝.
It is possible to add more then one datapicker curve. This is useful in case the imported image
contains several curves that need to be digitized. The datapicker curve that is currently being
selected in the Project Explorer is the ˝active˝ one - points clicked on the datapicker image will
be calculated and added to its data spreadsheet.
16
The LabPlot Handbook
Calculated values are stored in different columns in data spreadsheets in the datapicker. These
columns behave exactly the same like other columns in usual spreadsheets and can be directly
used as source columns for curves in your own plots.
Datapicker supports the process of the data extraction with several helpers. To place the points
more precisely, a magnification glass with different magnification levels is available. Also, the last
selected point can be shifted with the help of the navigation keys. Furthermore, when reading
data points having error bars, datapicker automatically creates bars indicating the end points of
the error bars. Those bars can be pulled with the mouse until the required length (the distance to
the data point) is reached.
The procedure for the extraction of data from an imported plot as described above is feasible
when dealing with a limited number of points. In case the curves in the imported image are
given as solid lines, the datapicker tool in LabPlot allows to read them (semi-)automatically. For
this, after a new datapicker curve was added as described above, switch to the mouse mode
˝Select Curve Segments˝. The curves on the plot are recognized and highlighted. By clicking
on a highlighted curve (or one of its segments), points along this curve are created. The length
of a segment and the density of created points (separation between two points) are adjustable
parameters. On the screenshots below, after switching to the segment mode all black lines were
highlighted (green colour). In this specific case, the curve was recognized as a single segment
and a single mouse-click on this segment is sufficient to digitize this curve and to automatically
place points along the curve.
In many cases the plot is not as simple as above (single black curve on white background) and
contains grid lines, many curves of different colour and thinness and a non-white background.
In such a case the automatic detection fails (too many or no objects are highlighted). To help the
datapicker to determine the curve(s) correctly, the user has to limit the allowed ranges in the HSV
(or HSI) colour spaces. To subtract the non-white background it is possible to limit the range for
the foreground colour, too. Internally, each pixel of the image is converted to black and white
where only the points fitting into the user-defined ranges for hue, saturation, value, intensity
and foreground are set to black.
On the screenshots below, the blue curves in the original image were projected onto by having
appropriately reduced the allowed ranges in the colour space (note the peak for blue in the his-
togram for the hue). The transformed black and white image contains only the curves the user is
interested in and it is now an easy task for the datapicker to determine the curves and to place
points on them.
17
The LabPlot Handbook
Similar to Worksheet, the currently visible area in the datapicker can be exported. The supported
image formats as described in the section Export Dialog.
• ASCII
• Binary
• Image
• NetCDF
• HDF5
• FITS
Preview of all supported file types is available in the import dialog. For data formats with com-
plex internal structures (like NetCDF, HDF5 and FITS), the content of the file is presented in a tree
view that allows comfortable navigation through the file. A versatile dialog to edit the headers
(keywords) of a FITS file is also provided.
Import of ascii and binary data compressed with gzip, bzip2 or xz can be done directly as the
decompression happens transparently for the user.
The name of the file containing the data to import has to be provided. The File Info button opens
a dialog where some information about the selected file is shown. The type of the data can be
specified - currently, only ASCII files containing several data sets (vectors) stored as columns are
supported. The filter - automatic or custom - determines how the file has to be parsed. Selecting
the filter ˝custom˝, several parameters like separating character etc. can be provided manually
in this case.
The start and end row to read can be customized using the Data portion to read tab. To read all
data specify -1 as an end row or column.
18
The LabPlot Handbook
19
The LabPlot Handbook
The content of a spreadsheet can be exported to an external text or FITS file. In the export dialog
for spreadsheets the user can specify the character separating values of different columns. Op-
tionally, the header of the spreadsheet (names of the columns in the spreadsheet) can be exported.
20
The LabPlot Handbook
Chapter 3
Command Reference
21
The LabPlot Handbook
22
The LabPlot Handbook
3.9 Toolbar
The main toolbar contains the main items that you can find in the different menus. More details
on this can be found in the KDE Fundamentals manual.
23
The LabPlot Handbook
Chapter 4
Plotting
4.1 Plots
Plots can be created inside a worksheet via ˝Add new˝ in the context menu or in the application
menu via ˝Worksheet˝ by selecting ˝xy-plot˝ and the type of plot you like to have.
Within this xy-plot you can add a xy-curve containing data to show (again via the context menu
or application menu).
The settings of a plot can be changed in the corresponding dock widget. There are general settings
like geometry but also the range of the x- and y-axis (including scaling). The plot title can be set
in the ˝Title˝ tab of the dock widget. Background and border styles can be changed in the ˝Plot
Area˝ tab.
4.2 Curves
Curves contain data points that can be shown in a plot. There are three different method to create
curves: the standard xy-curve, a xy-curve from a mathematical expression and a xy-curve from a
data analysis function.
The standard xy-curve can be filled with values of a spreadsheet by selecting the x-data and y-
data as column of the spreadsheet in the xy-curve dock widget. Another method to fill a curve is
to use a mathematical expression. Here you can select any mathematical function and range to
create the curve. The third method to create a curve is to use a data analysis function. The data
and the analysis function can be selected in the dock widget of the analysis function.
For all types of curves the line and symbols styles can be changed in the dock widget. Also
annotated values and error bar settings can be changed here.
4.3 Legends
A legend can be easily added to a plot by using the context of application menu. It contains
information about all curves in a plot.
The settings of a legend (format and geometry) can be changed in the legend dock widget. Also
the legend title settings, the legend background and the layout can be changed in the correspond-
ing tab of the legend dock widget.
24
The LabPlot Handbook
Chapter 5
Analysis functions
5.1 Overview
LabPlot supports a wide variety of data analysis functions:
• Data reduction
• Differentiation
• Integration
• Interpolation
• Smoothing
• Nonlinear curve fitting
• Fourier filter
• Fourier transform
All of them can be applied to any data consisting of x- and y-columns. The analysis functions
can be accessed using the Analysis menu or the context menu of a worksheet. The newly created
curves can be customized (line style, symbol style, etc.) like any other x-y-curve.
• Douglas-Peucker
• Visvalingam-Whyatt
• Reumann-Witkam
• Perpendicular distance simplification
• n-th point simplification
• Radial distance simplification
• Interpolation (nearest neighbor)
25
The LabPlot Handbook
• Opheim
• Lang
The desired tolerance is automatically calculated from the data but can also be changed in the
dock widget.
5.3 Differentiation
Numerical differentiation of data can be done specifying:
5.4 Integration
Numerical integration of data can be done specifying one of the methods
The default method (trapezoid) should be suitable for most cases. The number of resulting data
points is reduced for both Simpson-rules due to the properties of these methods.
5.5 Interpolation
Interpolation of data can be done with several algorithm:
• linear
• polynomial (if number of data points < 100)
• cubic spline
• cubic spline (periodic)
• Akima spline
• Akima spline (periodic)
• Steffen spline (needs GSL ≥ 2.0)
• cosine
• exponential
• piecewise cubic Hermite (finite differences, Catmull-Rom, cardinal, Kochanek-Bartels)
• rational functions
26
The LabPlot Handbook
The interpolating function is calculated with the given number n of data points and evaluated as:
• function
• derivative
• second derivative
• integral (starting from zero)
5.6 Smoothing
A number of different smoothing methods are supported:
All smoothing methods support several padding modes (constant, periodic, mirror, nearest, etc.)
for the beginning and end of the data set. The moving averages support several weight func-
tions (uniform, triangular, binomial, parabolic, tricubic, etc.) which can be selected to weight the
selected data points depending on their distance.
27
The LabPlot Handbook
• Low pass
• High pass
• Band pass
• Band reject (band block)
• Ideal
• Butterworth (order 1 to 10)
• Chebyshev type I or II (order 1 to 10)
• Optimal ˝L˝egendre (order 1 to 10)
• Bessel-Thomson (any order)
The cutoff value(s) can be specified in the units frequency (Hertz), fraction (0.0 to 1.0) or index of
the data points.
28
The LabPlot Handbook
Chapter 6
Curve Tracing
6.2 Symbols
Symbols are the points that can be drawn over image of datapicker. Symbols can be directly
created by mouse right click over the image. Symbols are mainly of two types, with and without
error-bar depending on the type of curve they belong.
Every curve of datapicker can have its own symbol style that can be changed in the Symbols sec-
tion of dock widget. ˝SelectAndMove˝ mouse mode can be used to select multiple points/sym-
bols and can be moved by using navigation keys.
29
The LabPlot Handbook
Every curve object contains all the curve points (hidden) and a spreadsheet that contains logical
positions of all its curve points, and provides options to update spreadsheet and to toggle visi-
bility of its curve points using the context menu. Mode Set Curve Points in the context menu of
datapicker should be selected in order to create curve points.
Multiple curve can be created for same datapicker. The created curve points always correspond
to the active curve of datapicker which can be changed via Active Curve option in the context
menu and dock widget of datapicker. Every curve of datapicker can have its own symbol style
that can be changed in the Symbols section of dock widget.
30
The LabPlot Handbook
Chapter 7
Advanced Topics
7.1 Topics
31
The LabPlot Handbook
Chapter 8
Short Tutorials
32
The LabPlot Handbook
2. Click on the Project item on the Project Explorer panel with the right mouse button and
choose Add new → Worksheet or press Alt-X on the keyboard.
3. Click on the Worksheet item on the Project Explorer panel with the right mouse button
and choose Add new → xy-plot → two axes, centered.
33
The LabPlot Handbook
4. Click on the xy-plot item on the Project Explorer panel with the right mouse button and
choose Add new → xy-curve from a mathematical equation.
5. Use the xy-equation-curve properties pane on the right to enter sin(x) into the y=f(x)
field (for the list of available functions please see chapter 10), -6 into the x, min field, 6 into
the x, max field and click on the Recalculate button to see the result.
34
The LabPlot Handbook
N OTE
LabPlot highlights unknown syntax in the y=f(x) field. This is useful to control the correctness of
the input.
I MPORTANT
The list of the known functions can be found in corresponding section of this manual.
6. Switch to the Line tab on the xy-equation-curve properties pane and choose cubic spline
(natural) from the Type drop down box.
35
The LabPlot Handbook
7. Switch to the Symbol tab on the xy-equation-curve properties pane and choose none from
the Style drop down list.
8. Click on the xy-plot item on the Project Explorer panel with the right mouse button and
choose Add new → legend. Switch to the Title tab on the Cartesian plot legend properties
pane and enter Graph of sine into the Text field.
9. Choose File → Export from the main menu. Select the place and the format to save the plot.
36
The LabPlot Handbook
37
The LabPlot Handbook
2. Click on the Project item on the Project Explorer panel with the right mouse button and
choose Add new → Spreadsheet or press Ctrl-= on the keyboard.
3. Click on the header of the first column of the spreadsheet with the left mouse button then
click on any of its cells with right mouse button and choose Selection → Fill Selection with
→ Row Numbers.
38
The LabPlot Handbook
Select Automatic (g) from the Format drop down box on the Column properties right dock
to enhance data presentation for the first column.
4. Click on the header of the second column of the spreadsheet with the right mouse button
and choose Generate Data → Random Values.
5. Click on the Project item on the Project Explorer panel with the right mouse button and
choose Add new → Worksheet or press Alt-X on the keyboard.
39
The LabPlot Handbook
6. Click on the Worksheet item on the Project Explorer panel with the right mouse button
and choose Add new → xy-plot → box plot, four axes.
7. Click on the xy-plot item on the Project Explorer panel with the right mouse button and
choose Add new → xy-curve.
40
The LabPlot Handbook
8. Use the xy-curve properties pane on the right to select Project → Spreadsheet → 1 in the
x-data field (just click on the item and press Enter). Use the same procedure to select 2 for
the y-data field. The results will be shown on the worksheet immediately.
9. Click on the Spreadsheet item on the Project Explorer panel with the left mouse button
then click on the second column header with the right mouse button and choose Sort →
Ascending.
41
The LabPlot Handbook
10. Click on the Worksheet item on the Project Explorer panel with the left mouse button to
see the results.
42
The LabPlot Handbook
Chapter 9
Examples
9.1 2D Plotting
Coming soon ...
Fourier filter
A time signal containing Morse code is Fourier transformed to frequency space to see the
main component. By applying a narrow band pass filter the Morse signal is extracted and
a nice ‘SOS’ can be seen:
9.3 Computing
43
The LabPlot Handbook
Maxima
Maxima session showing the chaotic dynamics of the Duffing oscillator. The differential
equation of the forced oscillator are solved with Maxima. Plots of the trajectory, the phase
space of the oscillator and the corresponding Poincaré map are done with LabPlot:
Python
Python session illustrating the effect of Blackman windowing on the Fourier transform:
9.4 Import/Export
Coming soon ...
9.5 Tools
Coming soon ...
44
The LabPlot Handbook
Chapter 10
Parser functions
Function Description
cbrt(x) Cube root
ceil(x) Truncate upward to integer
fabs(x) Absolute value
gamma(x) Gamma function
ldexp(x,y) x * 2y
ln(x) Logarithm, base e
log(x) Logarithm, base e
log1p(x) log(1+x)
log10(x) Logarithm, base 10
logb(x) Radix-independent exponent
pow(x,n) power function xn
powint(x,n) integer power function xn
pow2(x) power function x2
pow3(x) power function x3
pow4(x) power function x4
pow5(x) power function x5
pow6(x) power function x6
pow7(x) power function x7
pow8(x) power function x8
pow9(x) power function x9
rint(x) round to nearest integer
round(x) round to nearest integer
sqrt(x) Square root
tgamma(x) Gamma function
Returns the greatest integer less than or
trunc(x)
equal to x
45
The LabPlot Handbook
Function Description
sin(x) Sine
cos(x) Cosine
tan(x) Tangent
asin(x) Inverse sine
acos(x) Inverse cosine
atan(x) Inverse tangent
atan2(y,x) Inverse tangent function of two variables
sinh(x) Hyperbolic sine
cosh(x) Hyperbolic cosine
tanh(x) Hyperbolic tangent
asinh(x) Inverse hyperbolic sine
acosh(x) Inverse hyperbolic cosine
atanh(x) Inverse hyperbolic tangent
sec(x) Secant
csc(x) Cosecant
cot(x) Cotangent
asec(x) Inverse secant
acsc(x) Inverse cosecant
acot(x) Inverse cotangent
sech(x) Hyperbolic secant
csch(x) Hyperbolic cosecant
coth(x) Hyperbolic cotangent
asech(x) Inverse hyperbolic secant
acsch(x) Inverse hyperbolic cosecant
acoth(x) Inverse hyperbolic cotangent
sinc(x) Sinc function sin(π x) / (π x)
logsinh(x) log(sinh(x)) for x > 0
logcosh(x) log(cosh(x))
√
hypot(x,y) Hypotenuse function {x2 + y2 }
hypot3(x,y,z) √ 2 2 2
{x + y + z }
anglesymm(α) force the angle α to lie in the range (-π,π]
anglepos(α) force the angle α to lie in the range (0,2π]
Function Description
Ai(x) Airy function Ai(x)
Bi(x) Airy function Bi(x)
Ais(x) scaled version of the Airy function SAi (x)
Bis(x) scaled version of the Airy function SBi (x)
Aid(x) Airy function derivative Ai’(x)
Bid(x) Airy function derivative Bi’(x)
Aids(x) derivative of the scaled Airy function SAi (x)
46
The LabPlot Handbook
47
The LabPlot Handbook
48
The LabPlot Handbook
49
The LabPlot Handbook
50
The LabPlot Handbook
51
The LabPlot Handbook
Function Description
probability density p(x) for a Gaussian
gaussian(x,σ)
distribution with standard deviation σ
unit Gaussian distribution. They are
ugaussian(x) equivalent to the functions above with a
standard deviation of σ = 1
cumulative distribution functions P(x) for
gaussianP(x,σ) the Gaussian distribution with standard
deviation σ
52
The LabPlot Handbook
53
The LabPlot Handbook
54
The LabPlot Handbook
55
The LabPlot Handbook
56
The LabPlot Handbook
57
The LabPlot Handbook
10.5 Constants
Constant Description
e The base of natural logarithms
pi π
58
The LabPlot Handbook
Constant Description
c The speed of light in vacuum
mu0 The permeability of free space
e0 The permittivity of free space
h The Planck constant h
hbar The reduced Planck constant ℏ
na Avogadro’s number
f The molar charge of 1 Faraday
k The Boltzmann constant
r0 The molar gas constant
v0 The standard gas volume
sigma The Stefan–Boltzmann constant
gauss The magnetic field of 1 Gauss
The length of 1 astronomical unit (mean
au
earth-sun distance)
G The gravitational constant
ly The distance of 1 light-year
pc The distance of 1 parsec
The standard gravitational acceleration on
gg
Earth
ms The mass of the Sun
ee The charge of the electron
eV The energy of 1 electron volt
amu The unified atomic mass
me The mass of the electron
mmu The mass of the muon
mp The mass of the proton
mn The mass of the neutron
alpha The electromagnetic fine structure constant
ry The Rydberg constant
a0 The Bohr radius
a The length of 1 angstrom
barn The area of 1 barn
muB The Bohr Magneton
mun The Nuclear Magneton
mue The magnetic moment of the electron
mup The magnetic moment of the proton
sigmaT The Thomson cross section for an electron
pD The debye
min The number of seconds in 1 minute
h The number of seconds in 1 hour
d The number of seconds in 1 day
week The number of seconds in 1 week
in The length of 1 inch
ft The length of 1 foot
yard The length of 1 yard
mil The length of 1 mil (1/1000th of an inch)
v_km_per_h The speed of 1 kilometer per hour
v_mile_per_h The speed of 1 mile per hour
59
The LabPlot Handbook
60
The LabPlot Handbook
Chapter 11
61
The LabPlot Handbook
Chapter 12
License
LabPlot
Program copyright (c) 2007-2016 Stefan Gerlach stefan.gerlach@uni-konstanz.de Program copy-
right (c) 2008-2016 Alexander Semke Alexander.Semke@web.de
I MPORTANT
LabPlot is still under development. There is a long list of missing features that will be implemented in
later versions of LabPlot.
Because there are a lot things to do, developers need every help you can give. Any contribution
like wishes, corrections, patches, bug reports or screen shots is welcome.
Documentation copyright (c) 2007-2016 Stefan Gerlach stefan.gerlach@uni-konstanz.de Docu-
mentation copyright (c) 2008-2015 Alexander Semke Alexander.Semke@web.de Documentation
copyright (c) 2014 Yuri Chornoivan yurchor@ukr.net
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
62