# The LabPlot Handbook

Stefan
Gerlach

    gerlach@mbi-berlin.de

2006
Stefan Gerlach
&FDLNotice;
02/23/2006
1.5.1

&LabPlot; is a program for two- and three-dimensional function plotting and data analysis.

KDE
LabPlot
plot

## Introduction

&LabPlot; is a program for two- and three-dimensional graphical presentation of data sets and functions. &LabPlot; allows you to work with multiple plots which each can have multiple graphs. The graphs can be produced from data or from functions.

All settings of a complete set of plots can be saved in a project files. These project files may be opened by command line parameters, using the File menu, or by drag and drop.

Every object (title, legend, axes, axes label) can be dragged with the mouse. A double click on an object opens the corresponding dialog to change the options of the object.

The settings of a plot/graph may also be changed using the Appearance menu. With the Edit menu additional data sets and functions (graphs) can be included which can be displayed in the same as well as in different plot.

### &LabPlot; Revision History

- Version 1.5.1 (March 27, 2006)

  - new analysis functions : noise, signal filter, auto-/crosscorrelation and capability analysis

  - "add graph" dialog in graph dialog

  - improved set-value dialog in spreadsheet

  - support for panel plots and improved surface and pie plot

  - much improved explorer dialog with drag and drop

  - save and restore sheets position/size in project

  - statistics on columns/rows and fitting in spreadsheets

  - new axes tic style and fill between curves

  - support for richtext in legend

  - save settings and update open dialogs

  - optional xml project format (will be used later as standard format)

  - lot of bug fixes

- Version 1.5.0 (August 15, 2005)

  - more weightings+residuals for regression/nonlinear fit

  - added wavelet and Hankel transform and improved analysis functions

  - improved surface and qwt 3d plot

  - improved behaviour with non-linear scales and LaTeX label support

  - import/export data from/to PostgreSQL, mySQL, etc. via KexiDB

  - import Origin opj projects (Origin worksheets only)

  - better scripting support

  - many bug fixes

- Version 1.4.1 (March 28, 2005)

  - nonlinear fit any user-defined function with up to 9 parameter

  - configure default value for plot style and symbols

  - clone graphs and delete/clone plots

  - improved import/export settings with support for binary data

  - more analysis functions : compress, peak find, periodical, seasonal

  - regression/nonlinear fit of data with errorbars

  - speed mode for large data sets and data mode for inspecting data points

  - zoomin/zoomout, marker and improved axis grid

  - mask data points in spreadsheet and plot

- Version 1.4.0 (December 15, 2004)

  - versatile spreadsheet with data import, editing, etc.

  - new 3d plot with rotation and colormaps (using qwtplot3d library)

  - double buffered plotting (no flicker)

  - data set operations

  - import/export of over 80 image formats (svg, fits,...) and better image handling

  - direct export to ps, eps, pdf via ghostscript

  - simple scripting using QSA

- Version 1.3.1 (August 30, 2004)

  - native export to svg, eps and more graphic formats

  - support for ternary and polar plots

  - added (de)convolution and interpolation

  - better zooming, errorbar plotting and annotate values

  - more plot symbols and brush

  - reading and writing of netcdf, cdf and audio (wav,au,snd,aiff,...) files

  - improved graph list dialog

  - new file info dialog

- Version 1.3.0 (June 14, 2004)

  - multiple plots per worksheet

  - handling of time and date format

  - improved axes settings

  - improved surface (density, contour) plots

  - improved nonlinear fit

  - support for pie plots

  - improved documentation

  - German handbook

- Version 1.2.3 (February 16, 2004)

  - linear regression and nonlinear fit

  - improved fourier transform using gsl or fftw

  - integration, differences and histograms

  - creating, editing and moving drawing objects with mouse

  - reading/writing of compressed data (gzip,bzip2)

  - &kde; KPart for LabPlot project files

  - more bugfixes and improved German translation

- Version 1.2.2 (December 17, 2003)

  - logarithmic scales of axes

  - support of drawing objects

  - support for gsl special functions and distributions

  - fourier transform via gsl

  - export to pdf, fig, dxf, etc. via pstoedit

  - export to > 100 different image formats via ImageMagick

  - more bugfixes

- Version 1.2.1 (October 26, 2003)

  - much improved GUI

  - better &kde; integration

  - richtext title and axes label

  - improved 3d plotting

  - new analysis functions

  - better data reading

  - configure and save user settings

  - examples

- Version 1.2.0 (September 08, 2003)

  - new improved internal plot structure

  - parser support for functions with more parameters

  - new surface plot with contour support and legend

  - support for JPEG2000 and tiff

  - user guide (this handbook)

  - more bugfixes

- Version 1.1.1 (July 26, 2003)

  - matrix-data-reading

  - density plots from function and data

  - parser completely rewritten

  - colored and scaled printing

  - export plot as graphics

  - more flexible data reading

  - improved axis tics label (format and position)

  - more bugfixes

- Version 1.1 (June 22, 2003)

  - more object attributes (title color, grid color, etc.)

  - support 2d errorbars

  - drag and drop of the title, the axes with correct rescaling

  - improved save and open of all plots in a project file

  - lots of bug fixes

- Version 1.0.3 (May 11, 2003)

  - Plot list in menubar

  - improved workspace management

  - drag and drop of the legend

  - EditDialog for editing data

- Version 1.0.2 (April 4, 2003)

  - shift plot with toolbuttons

  - scaling of plot with toolbuttons

  - opening Dialogs via mouse click

  - improved print preview

- Version 1.0.1 (March 18, 2003)

  - Print Preview implemented

  - introduced graph label different from name

- Version 1.0 (March 3, 2003; renamed to LabPlot)

  - support for &kde; 3.0 and &kde; 2.x

  - automake and autoconf scripts (./configure)

- Version 0.9.x (February 26, 2003)

  - improved DataDialog

  - save and open of an Plot

  - started with i18n (de)

  - started with migration from &Qt; to &kde;

  - improved ListDialog

  - changing of data and function graphs in ListDialog

  - support for grid in 2d and 3d plots

- Version 0.4.0 (October 7, 2002)

  - support for 3D Plots

  - using GraphList for storing all graph of a plot

  - better scaling of the whole plot

  - new class GraphM for matrix-data support

- Version 0.2.1 (June 30, 2001)

  - Legend in Plot

  - ListDialog for all graphs in a Plot

- Version 0.2 (June 16, 2001)

  - first PlotWidget with single graph

  - creating data via FunctionDialog

- Version 0.1 (May 20, 2001; first release under the name QPlot)

## Features

This chapter tries to provide a complete list of the features of LabPlot.

2D and 3D data and function plotting

- flexible data reading/writing in different formats (including cdf, netcdf, audio, binary, images, databases)

- reading and writing of images and compressed data

- extensive parser for creating 2d, 3d functions

- support for all GNU Scientific Library (GSL) functions and constants

- creating surface, polar, ternary, and pie plots from function and data files

- flexible 3d plot with rotation

- multiple plots per worksheet

- data set operations

- speed mode for large data sets and data mode for inspecting data points

Easy editing of plots

- clone graphs and delete/clone plots

- versatile spreadsheet for data manipulation

- double click to open detailed dialogs for all settings

- every object can be dragged by mouse

- online scaling and shifting of plots

- LaTeX and richtext label support

- evaluating expressions and direct editing of data

- data statistics information

- drawing objects editable with mouse

- free or pan zooming, masking of data points and marker

- "add graph" dialog in graph dialog

- support for panel plots

Analysis of data and functions

- average, smooth and prune data

- compress, periodical and seasonal analysis

- peak find

- interpolation (splines, etc.)

- differences

- integration

- histogram

- regression (up to 10th order)

- non-linear fit (also any user defined function with up to 9 parameter)

- fourier, Hankel and wavelet transform

- (de)convolution

- image manipulation

- noise, signal filter and auto-/crosscorrelation

- capability analysis

LabPlot project files

- support for different worksheets and spreadsheets using MDI

- save and open all worksheets and spreadsheets in a project file (*.lpl)

- editable project information

- export worksheets as image, ps, eps, svg, pdf and many more formats (using pstoedit or ImageMagick)

- import/export data from/to PostgreSQL, mySQL, etc. via KexiDB

- many example projects files

- optional xml project format (will be used later as standard format)

- import of Origin opj projects

&kde; look and feel

- configure default value for plot style and symbols

- print and embedded print preview

- drag and drop support

- KPart for LabPlot projects

- &kde; handbook (English and German)

- complete scriptable using &Qt; Script for Applications (QSA)

## Using &LabPlot;

### Command Line Options

#### Specify a File

When starting &LabPlot; from the command prompt, you can supply the name of a project file:

    LabPlot file.lpl

#### Other Command Line Options

The following command line help options are available

`LabPlot `--help``

  This lists the most basic options available at the command line.

`LabPlot `--help-qt``

  This lists the options available for changing the way &LabPlot; interacts with &Qt;.

`LabPlot `--help-kde``

  This lists the options available for changing the way &LabPlot; interacts with &kde;.

`LabPlot `--help-all``

  This lists all of the command line options.

`LabPlot `--no-splash``

  do not show the splash screen

`LabPlot `--author``

  Lists &LabPlot;'s author in the terminal window

`LabPlot `--version``

  Lists version information for &Qt;, &kde;, and &LabPlot;. Also available through `LabPlot `-v``

### The Spreadsheet

The spreadsheet is the main part of LabPlot when working with data. For controlling and converting data the spreadsheet contains a customizable table. Every column of the table has a certain label and can be assigned a format (like double or datetime format).

You can import via the import dialog. Any spreadsheet function can be reached via the context menu (right click). You can cut, copy and paste between spreadsheets, fill, normalize and convert data and finally make plots out of your data. Of course you can export the data in the spreadsheet here too.

Since version 1.4.1 you can mask certain data points in the spreadsheet which are excluded from plotting. The masking of datapoints can be later influenced in the graph list dialog.

### The Worksheet

The worksheet contains all the plots and drawing objects. You can customize the worksheet in the worksheet dialog.

The worksheet can contains multiple plots with different characteristics. To arrange or overlay plots in a worksheet use the "arrange plots" or "overlay plots" menu items.

### Drag and Drop

&LabPlot; supports the Drag and Drop protocol of &kde; and &Qt;. This means that you can open a project by dragging their symbols onto the &LabPlot; window. Project files should have the extension `.lpl`.

### Positioning with the Mouse

&LabPlot;supports dragging of the axes, title, legend and axes label with the mouse.

To move an item, its area has to be clicked with the &LMB; When the mouse is moved with the &LMB; pressed, the plot is continously updated to display the new position. After releasing of the mouse button the item is dropped there.

### Status Bar

The horizontal and vertical positions of the mouse pointer in the plot area are displayed in data units on the left side of the status bar at the bottom of the LabPlot window.

### Side Tool Bar

From the side tool bar many functions can be reached easy. You can select to zoom, move or scale a plot here. Also some more enhanced functions like data mode (to inspect single data points) or masking of data points can be selected here too. For more information take a look here.

## Command Reference

### The File Menu

&Ctrl;n File New

  Creates a new &LabPlot; project file.

  In a project file all settings and all plots are stored in ASCII format.

&Ctrl;o File Open

  Opens a &LabPlot; project file.

File Open Recent

  Opens a recent &LabPlot; project file.

  Here the last used 10 project files are listed.

&Ctrl;s File Save

  Saves the actual project.

  If you haven't saved the project before the project is saved under a temporary project file name.

&Ctrl;a File Save As

  Saves the actual project under a different name.

File OpenXML

  Open project from a LabPlot XML file.

File SaveXML

  Save project to a LabPlot XML file.

&Alt;v File Project Infos

  This dialog gives you the possibility to watch and change some project related options like title, author, creation date, etc. This information is saved in the project file and can be used to save some additional information about a project.

&Ctrl;> File Project Explorer

  This dialog gives you an overview of the structure of a project. In future releases there may be some additional functionality here like adding deleting graphs, plots or worksheets.

&Ctrl;&Shift;l File Import

  Import data into the active spreadsheet

  This item can be used to import data into LabPlot. Please read more in the import dialog section.

&Ctrl;&Shift;j File Import OPJ project

  Import OPJ project

  This item can be used to import Origin OPJ projects into LabPlot.

&Ctrl;r File Export to Image

  Saves the active plot as a graphic.

  Here you have the possibility to save the active plot under different image formats. Currently supported are : bmp, jpg, jpg2000, pbm, pgm, png, ppm, tiff, xbm and xpm.

&Ctrl;o File Export to ...

  Saves the active plot as special format.

  Currently supported are : Postscript (PS), Encapsulated Postscript (EPS), Portable Document Format (PDF), Scalable Vector Graphics (SVG) and the native QPicture Format (PIC).

&Alt;e File Export via pstoedit

  Export the active plot to different formats.

  Here you have the possibility to export the active plot to different file formats via pstoedit. Supported are : dxf, fig, eps, and many more.

&Alt;i File Export via ImageMagick

  Export the active plot to different image formats.

  Here you have the possibility to export the active plot to different image formats via ImageFormats. Supported are over than 100 different formats! Please see the documentation of ImageMagick for more informations.

&Ctrl;p File Print

  Prints the active plot.

  Here a print dialog is opened where you can select the printer, different paper sizes, etc.

&Alt;p File Print Preview

  Open a print preview.

  This item opens an embedded print preview of the active plot in A5 landscape. If the print preview is active you can close it with this item.

&Ctrl;q File Quit

  Quit LabPlot.

### The Edit Menu

&Ctrl;Shiftn Edit New 2D Plot

  This is used to open a new empty 2D Plot in the current worksheet.

&Alt;z Edit New Surface Plot

  This is used to open a new empty surface plot in the active worksheet.

&Ctrl;m Edit New 3D Plot

  This is used to open a new empty 3D Plot in the active worksheet.

&Ctrl;Shiftq Edit New QWT 3D Plot

  This is used to open a new empty QWT 3D Plot in the active worksheet.

&Alt;. Edit New Pie Plot

  This is used to open a new empty Pie Plot in the active worksheet.

&Ctrl;Shifto Edit New Polar Plot

  This is used to open a new empty Polar Plot in the active worksheet.

&Ctrl;Shiftt Edit New Ternary Plot

  This is used to open a new empty Ternary Plot in the active worksheet.

&Alt;q Edit Delete Active Plot

  This is used to delete the active plot in the current worksheet.

&Alt;> Edit Clone Active Sheet

  This item can be used to clone the active spreadsheet / worksheet.

&Ctrl;ShiftS Edit New Spreadsheet

  This is used to open a new spreadsheet.

&Alt;x Edit New Worksheet

  This is used to open a new worksheet.

&Ctrl;g Plot Graph List

  Opens the graph list dialog.

  In the list dialog you can manipulate the graphs of the active plot. This dialog can also be reached by double clicking on a plot.

&Ctrl;&Shift;. Plot Plot List

  Opens the plot list dialog.

  In the plot list dialog you can manipulate the plots of the active worksheet.

Plot New Plot from Function

  Opens the function dialog.

  This item opens the function dialog to create a plot from a user defined function.

&Ctrl;e Plot New Plot from Function 2DFunction

  Opens the 2d function dialog.

  This item opens the function dialog to create a 2 dimensional graph from a user defined function.

&Ctrl;u Plot New Plot from Function 2D Surface Function

  Opens the 2d surface function dialog.

  This item opens the function dialog to create a 2 dimensional surface graph from a user defined function.

&Alt;< Plot New Plot from Function Polar Function

  Opens the polar function dialog.

  This item opens the function dialog to create a 2 dimensional polar graph from a function.

&Ctrl;f Plot New Plot from Function 3D Function

  Opens the 3d function dialog.

  This item opens the function dialog to create a 3 dimensional graph from a user defined function.

Plot New Plot from Data

  Opens the data dialog.

  This item opens the data dialog to create a plot from data.

&Ctrl;d Plot New Plot from Data 2D Data

  Opens the 2d data dialog.

  This item opens the data dialog to create a 2 dimensional graph from a data file. You can specify a lot of options for reading data so you should be able to read any type of ASCII data here.

&Alt;- Plot New Plot from Data 2D Surface Data

  Opens the 2d surface data dialog.

  This item opens the data dialog to create a 2 dimensional surface graph from a data file.

&Alt;, Plot New Plot from Data Pie Data

  Opens the pie data dialog.

  This item opens the data dialog to create a 2 dimensional pie graph from a data file.

&Ctrl;, Plot New Plot from Data Polar Data

  Opens the polar data dialog.

  This item opens the data dialog to create a 2 dimensional polar graph from a data file.

&Ctrl;ShiftY Plot New Plot from Data Ternary Data

  Opens the ternary data dialog.

  This item opens the data dialog to create a 2 dimensional ternary graph from a data file.

&Ctrl;i Edit New Plot from Data 3D Data

  Opens the 3d data dialog.

  This item opens the data dialog to create a 3 dimensional graph from a data file. You can specify a lot of options for reading data so you should be able to read any type of ASCII data here.

&Ctrl;ShiftB Plot New Plot from Data QWT 3D Data

  Opens the QWT 3D data dialog.

  This item opens the data dialog to create a 3 dimensional qwt plot from a data file.

Plot Speed Mode

  Toggles the speed mode setting

  This item can be used to switch the speed mode on or off. The speed mode can be used to accelerate the drawing for large datasets by drawing only a limited number of data points. The number of datapoints can be selected in the settings dialog.

&Ctrl;c Edit Clear

  Clear the active plot. With this item all graphs in the active plot are deleted and you get an empty plot like from "New 2D/3D/Surface/Pie Plot".

  If the active sheet is a spreadsheet it is cleared too.

&Ctrl;w Edit Close

  Closes the active sheet. With this item you can also close the print preview.

### The View Menu

This menu contains all the items that can also be found in the side tool bar.

### The Spreadsheet Menu

This menu contains all the items that can also be found in the context menu (right mouse) of a spreadsheet. If no spreadsheet is active, you can add a new spreadsheet.

### The Analysis Menu

Please also check out the detailed informations about the analysis functions.

&Ctrl;# Analysis Evaluate Equation

  Lets you evaluate any equation

&Ctrl;Shiftd Analysis Data set operations

  Opens the Operations Dialog

  Here you can operate on data sets that means add or multiply the values of different graphs.

&Ctrl;Shiftk Analysis Periodic Periodic Function

  Opens the Periodic Dialog

  Lets you investigate periodic data.

&Ctrl;Shiftu Analysis Periodic Seasonal

  Opens the Seasonal Dialog

  Lets you compress periodic data.

&Ctrl;Shiftx Analysis Peak find

  Opens the Peak Find Dialog

  Here you can find peaks in a data set.

&Alt;h Analysis Histogram

  Opens the Histogram Dialog

  Here you can create a histogram of any graph. Choose the range and bins for the histogram in this dialog.

  You need gsl installed to use this.

&Alt;i Analysis Interpolation

  Opens the Interpolation Dialog

  Here you can interpolate any graph. You can choose the type of interpolation the range and the number of points for the resulting function in this dialog.

  You need gsl installed to use this.

&Alt;d Analysis Differences

  Opens the Differences Dialog

  Here you can create a graph of numerical differences for selected data (derivation of a function).

&Alt;n Analysis Integration

  Opens the Integration Dialog

  Here you can numerical integrate the selected graph. Define the needed region or use the active region (can be defined under the appearance menu.)

  You need gsl installed to use this.

&Alt;a Analysis Filter Average

  Opens the Average Dialog

  Here you can create a new graph from the averaged data of any other graph.

&Alt;s Analysis Filter Smooth

  Opens the Smooth Dialog

  Here you can create a new graph from the smoothed data of any other graph.

&Ctrl;Shifth Analysis Filter Compress

  Opens the Compress Dialog

  Compress data sets.

&Alt;r Analysis Filter Prune

  Opens the Prune Dialog

  Here you can create a new graph from the pruned data of any other graph.

&Alt;r Analysis Filter Noise

  Opens the Noise Dialog

  Lets you add a certain noise to your data.

&Alt;r Analysis Filter Signal Filter

  Opens the Signal Filter Dialog

  Lets you apply a (signal) filter to your data.

&Alt;f Analysis Transform FFT

  Opens the FFT Dialog

  Here you can make a fast fourier transform of the selected graphs. If supported on your platform you can choose what library is actually used for the fourier transform (GNU scientific library (gsl) or the Fastest Fourier Transform in the West (fftw)). You can make forward or backward transform, make the x-Axis index, frequency or period and create the y-axis as magnitude, real, imaginary or phase.

  You need gsl installed to use this.

&Alt;C Analysis Transform Convolution/Deconvolution

  Opens the Convolution Dialog

  In this dialog you can make a convolution/deconvolution of one graph with another. The used x-values can be selected.

  You need gsl installed to use this.

&Ctrl;+ Analysis Transform Auto-/Crosscorrelation

  Opens the Correlation Dialog

  In this dialog you can make an auto-/crosscorrelation of one/two graphs.

  You need gsl installed to use this.

&Ctrl;Shift< Analysis Transform Wavelet Transform

  Opens the Wavelet Dialog

  You need gsl installed to use this.

&Ctrl;Shift> Analysis Transform Hankel Transform

  Opens the Hankel Dialog

  You need gsl >= 1.6 installed to use this.

&Alt;; Analysis Statistics Capability Analyis

  Opens the Capability Dialog

  You need gsl installed to use this.

&Alt;l Analysis Regression

  Opens the Regression Dialog

  In this dialog you can make a regression of your data with different models and weight. The region can be defined here to.

  You need gsl installed to use this.

&Alt;t Analysis Nonlinear Fit

  Opens the Nonlinear Fit Dialog

  With this dialog you can make a nonlinear fit of your data. Currently 12 different models and any user defined model with up to 9 parameter can be selected. Start values, steps and tolerance for the non-linear least-square fit using gsl can be set.

  You need gsl installed to use this.

&Ctrl;Shiftg Analysis Image Manipulation

  Opens the Image Manipulation Dialog

  With this dialog you can manipulate matrix or image data as image. Operations like rotate, scale, sharpen or brighten can be performed here. Please see the analysis function overview.

### The Appearance Menu

&Alt;y Appearance Arrange Plots

  Opens the arrange dialog.

  Here you can specify how to arrange plots on a worksheet.

&Ctrl;- Appearance Overlay Plots

  Opens the overlay dialog.

  Here you can exactly overlay a plot onto another.

&Ctrl;j Appearance Plot Settings

  Opens the plot dialog.

  Here you can change the settings of the active plot.

&Alt;w Appearance Worksheet Settings

  Opens the worksheet dialog.

  Here you can make the settings of the active worksheet.

&Ctrl;b Appearance Axes Settings

  Opens the axes dialog.

  Here you can change the settings of the axes in a plot.

&Ctrl;t Appearance Title Dialog

  Opens the title dialog.

  Here you can change the settings of the title in a plot.

&Ctrl;l Appearance Legend Dialog

  Opens the legend dialog.

  Here you can change the settings of the legend in a plot.

&Alt;o Appearance Drawing objects

  Opens the objects dialog.

  Here you can add new drawing objects and change their settings.

### The Drawing Menu

In this menu the baseline and the region of a plot can be defined. Also 5 different types of drawing objects can be easily created here.

With "Create Baseline" you can create a baseline which is used for filling of graphs and for integration. With "Create Region" a region can be defined. A Region is used for nonlinear fitting, integration, etc.

With the 5 other items the different drawing objects can be easily created by mouse. Please follow the hints in the statusbar.

### The Sheet List Menu

This menu gives you a list of all worksheets and spreadsheets of a project. You can select the active (and shown) sheet here.

### The Graph List Menu

This menu gives you a list of all graphs of a worksheet. You can directly change the settings of a graph by selecting the corresponding item here.

### The Scripting Menu

This menu collects items that can be used to manipulate scripts to automate LabPlot functions

Check out the Scripting Chapter for using the scripting interface of LabPlot

&Ctrl;&Shift;c Script Load Script

  Load and Execute a &Qt; Script for Applications (QSA) script (*.qs).

&Ctrl;&Shift;w Script Open QSA Workbench

  Open the QSA workbench to create and edit QSA scripts (*.qs).

### The Settings Menu

This menu gives you the ability to change user settings.

&Ctrl;&Shift;f Settings Fullscreen

  Show the workspace in full screen mode.

&Ctrl;m Settings Show Menubar

  Toggle the menubar.

Settings Configure LabPlot

  Configure user settings of LabPlot. The default Style and Symbol for 2D or Surface plots can be set here too.

Settings Save settings

  Save all the user settings of LabPlot.

### The Help Menu

F1 Help Contents

  Here the contents page of the help for &LabPlot; is available.

Help Examples

  Here you will find many &LabPlot; example projects.

Help About LabPlot

  Displays essential information about &LabPlot;.

### Main Tool Bar

The main toolbar contains the main items that you can find in the different menus. You can adapt the shown items in Settings->Configure Toolbars ... dialog

### Side Tool Bar

The &LabPlot; side tool bar contains the following buttons:

Button | Action
--- | ---
Lens | magnify lens
Hand | pan zoom
data mode | inspect single data points.
mask data | select data points to mask.
X | Autoscale X.
Y | Autoscale Y.
Z | Autoscale Z.
+ | zoom in.
- | zoom out.
Left | Shift all graphs to the left.
Right | Shift all graphs to the right.
Up | Shift all graphs up.
Down | Shift all graphs to the down.
X+ | Increases magnification in X.
X- | Decreases magnification in X.
Y+ | Increases magnification in Y.
Y- | Decreases magnification in Y.
Z+ | Increases magnification in Z.
Z- | Decreases magnification in Z.

## The Dialogs

### Function

The dialog Function is used to create and perform the settings for function plots. It looks the same for 2d, surface, pie and 3d plots. Only a few plot specific things differ. Especially the Style is different for surface plots.

The first lineedit contains the expression for the plot function. The entered expression is evaluated via a powerful parser. For a complete list of supported functions see the parser section.

the second lineedit is for setting the label of the created graph. This is the label which you see in the legend.

In the "Range" and "Number of Points" section you can select the range and the number of points for the created function.

With the remaining style items you can influence the appearance of the function. If you create a normal function the first selection defines the line style (Lines, NoCurve, Steps, Boxes, Impulses, Y Boxes), the color and if you want to have it filled (with a different color). The other items select the symbol for the plot points, with color, size, if it should be filled and with which color. If you create a surface plot you have the possibility to select whether to show a density or contour plot, or both. Then you can select the number of levels for contour plots and the colorscale for density plots.

For changing the settings of a function you have to select the change button in the list dialog. For changing the style of a surface plot you can also use the "Plot Settings" dialog.

Since version 1.4.0 LabPlot uses the new QWT 3D Plot which should be preferred to the simple 3d plot.

### Data

The dialog Data is used to create graphs from data files.

This dialog looks very similar to the function dialog. There are some differences though. You have to select a data file to open in the first lineedit. You can use the "New" button to open a file dialog for this. In the "Read from column" section you can enter from which column you want to read the corresponding values. If unsure use the check button to have a look at the data file. You can select here also from which to which row to read data and what separating character is used. The "auto" separation detects all number and combination of whitespaces.

When using "y1 | y2 | y3 | ..." in the "read as" selection the y-values are read from one line in the data files.

LabPlot supports the reading of images (all &Qt; supported formats) and compressed data too (gzip, bzip2). for images you should select "matrix" to read the data of the image.

Since version 1.3.1 LabPlot can also read netcdf, cdf and audio data (*.wav,*.au,*.aiff,*.snd,...). For netcdf and cdf data just select the variables in the x,y, etc. line edits and maybe check it in the "check data" dialog. For finding the correct variables you can use the file info dialog to check the content of a netcdf/cdf file. When reading audio data just select 1 for the time, 2 for the first channel and 3 for the second channel. 0 of course means index like when reading any other data file.

The "Read As" section selects the kind of data in the data file. The "Graph Type" selects the type of graph to create. From x-y data you can make only 2 dimensional plots. From x-y-z data you can create error and surface plots (2D data dialog) or density, contour or 3d plots (3D data dialog). From matrix data you can create density or contour plots (2D data dialog) or 3d plots (3D data dialog).

Since version 1.4.0 LabPlot uses the new QWT 3D Plot which should be preferred to the simple 3d plot.

### Plot List

In the plot dialog you can manipulate the plots in a worksheet. You can clone or delete plots here.

### Graph List

The list dialog is the central point for dealing with the different graphs of a plot. Here you have an overview of all graphs and you can manipulate them. You can reach the list dialog via the Plot->GraphList menu or by double clicking inside the plot. All mentioned functions can be reached in all list dialogs with the &RMB;

With "Show/Hide" you can toggle the state all selected graphs. Only "Shown" graphs are visible in the plot. The autoscaling function also uses only the visible graphs.

With the buttons "Add Datafile" and "Add Function" you can add a graph from data or function to the plot. (see function dialog or data dialog. ) With "Delete" you can easily delete the selected graph. With "Change" you can change the settings of the selected graph. If you just want a copy of an existing graph use the "clone graph" button.

The "Export" button opens the dump dialog to export a graph to a file and the "Edit" button gets you to the edit dialog.

With "Toggle Masking" and "Unmask All" you can change the masking of different data points.

The "Statistics" button shows some statistics about the selected graphs.

Every manipulation can also be reached via the right mouse button. Multiple selections are possible.

#### Add Graph

Here you can add graphs from another worksheet or from any spreadsheet.

### Import Dialog

With the import dialog you can import data into LabPlot.

In the line edit you can specify multiple data files to read. The "File Info" button shows you some informations about the selected files. You can also specify the separating character (for instance ",") and the comment line character. The start and end row to read can also be customized here.

Since version 1.4.1 of LabPlot you can select pre-defined filter for different standard data formats that select all needed settings. Also support for binary data import was added with this release.

### Edit

With the edit dialog you can easily edit the data of a graph. You can reach this dialog via the list dialog.

The table on the top side shows you all the data. Here you can select which rows and columns you want to edit. You can delete or sort selected rows ascending or descending with the buttons under the Table. You can also evaluate an expression to the selected rows and columns. Here the same powerful parser features like in the function dialog can be used. For a list of available functions see the parser section.

### Objects

With the objects dialog you can change the settings of all drawing objects. The object dialog can be found in the appearance menu.

There are 5 tabs for every type of drawing object. Line, Label, Rect, Ellipse and Image. For every object type you can define up to 10 different objects. All settings can be changed in this dialog. If you want to delete an object, select the object in the object list and push the "delete object" button.

If you want to create objects, you can use the items in the drawing menu. The objects then can be moved with the mouse. Double-click on an object opens the corresponding tab of the object dialog.

### File Info

The file info dialog can be reached from the data dialog. Here you can find a lot of informations about a data file. Especially for netcdf, cdf and audio files you can have a look at the internal structure of a data file.

### Dump

The dump dialog can be reached from the graph list dialog. Here you can export a graph to ASCII, netcdf, cdf, audio, binary or an image file. Every type of file has special options. You can also specify the range of data to export.

For ASCII data the file is automatically compressed when appending .gz or .bz2 to the filename.

### Appearance

With the four appearance dialogs you can influence the settings of the active plot. You can reach this dialogs via the "Appearance" menu or by double clicking on the object in the plot.

#### Plot Settings

The graph dialog lets you select the background color, the graph background color (inside the plot) and the ranges for the different axes. Also marker or baseline settings can be changed here. The autorange functionality can also be reached from the side tool bar. If you have a surface plot you can also change the style settings here.

If the active plot is a QWT 3D plot you can select some special settings here. The plot style changes the surface of the 3d mesh. The coordinate style changes the coordinates. The floor style enables contour or density plots on the floor with a user specified number of isolines. Finally you can select a special colormap (139 different colormaps are provided by LabPlot per default).

#### Worksheet Settings

With the worksheet dialog you can change the title of a worksheet and the timestamp. The title and timestamp can be enabled or disable here too.

#### Axes

The axes dialog lets you change the settings for the different axes. It opens if you click on one of the axes.

In the upper region you have a list of all axes. Here you can select the axis to change. To enable or disable the axis use the checkbutton at the top of the dialog. Under the axes list you have different tabs to change a lot axis settings (color, tics, grid, etc.).

#### Title

In the title dialog you can change parameters of the title (label, size and font). The dialog open with double clicking on the title.

#### Legend

In the legend dialog you can change parameters of the legend (boxed, size and font). The dialog open with double clicking on the legend.

### Analysis

With the analysis dialogs you can analyse a graph with different methods. By applying a method you create a new graph which is inserted in the active plot.

All analysis functions allows you to select the destination for the resulting data. You can add the result to any existing worksheet/spreadsheet or to a new worksheet/spreadsheet.

Most of the analysis functions can also be applied to a spreadsheet. From the selected columns of the spreadsheet a new column with the resulting values is created.

#### Analysis functions of LabPlot

Name | Description | Parameter | Applies to
Data set operations | If you have at least two graphs in the active plot you can operate on this data set in this dialog. You can add, substract, multiply and divide data sets here. | two datasets
Average | With this function you can average over n points of a graph. The number of points is reduced by a factor of 1/n. | number of points to average | everything
Compress | This function can compress large datasets to less points. You can select whether to sum or average over a certain number of points. | sum or average; number of points | everything
Smooth | This function does the same as average but for every data point. So you will get a smoothed graph with the same number of data points. | number of points | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY, X-Y-Z
Prune | This function reduces the number of data points by just using every n-th point. The resulting number of points is reduced by a factor of 1/n. | number of consecutive points | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Periodical Functions | This function can be used to reduce a dataset to one period of a function. You can select whether to sum or average. | sum/average; points per period | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Seasonal | This function can calculate the difference (or sum) of on period to the next one. The period is specified by the number of points in it. | sum/difference; points per period | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Peak find | This function allows you to find the peaks (also negative peaks) in a data set. The sensitivity for finding peaks can be specified with the parameters threshold and accuracy | positive/negative peaks;threshold (Y-Range); accuracy (X-range) | X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Histogram | With this function you can make a histogram of a graph. That means that the y-range is separated in n bins and every datapoint fitting in one bin is counted. | used Y-range; number of bins | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY, MATRIX
Interpolation | Interpolation tries to find a smooth curves through a given set of data points. You can use different types of interpolation to do that : linear, polynomial, cspline, akima. All datapoints in the active region are used for interpolation. | interpolation type; range/number of points for interpolating function | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Differences | This dialog creates an approximation of the first derivative of a graph. | None | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Integration | This function can be used to numerical integrate a graph. With the "Add Graph" checkbox you can select whether to add the integrated graph. With the "Show Info" checkbox selected the cumulative sum is shown in a separate window. | baseline/region for integration; sum or area (absolute values) | SPREADSHEET, X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Regression | The regression function can be used to fit a graph with polynomials up to the 10-th order. | weight/model; number of points/range for regression function | X-Y,X-Y-DY,X-Y-DX-DY
Fourier Tansform | With this function you can calculate the fourier transform of a graph. LabPlot can use the fftw or gsl library for that. You can select whether to transform forward or backward. | X-values:index/frequency/period; Y-values:magnitude/phase/real part/imaginary part | X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY
Convolution/Deconvolution | With this function you can calculate the convolution of one graph with another. LabPlot uses the FFT of gsl for that. It is also possible to deconvolve a set. | X-values:index/same as signal | X-Y, X-Y-DY, X-Y-DY-DY + X-Y, X-Y-DY, X-Y-DY-DY

Nonlinear Fit

With this function you can fit a graph in a nonlinear fashion. You can select one of 12 different models or any user defined function with up to 9 parameters. Please note that fitting especially exponential models is very sensitive to the initial values. The resulting fit parameter are shown in the bottom field and automatically replaced as initial values for further fitting. The results are added to the plot as label.

fit function;initial values;baseline/region for fitting; range/number of points for fit function

X-Y, X-Y-DY, X-Y-DX-DY, X-Y-DY-DY

Image Manipulation | In this function you can manipulate matrix or image data of the active plot (for instance a surface plot). LabPlot uses the API of ImageMagick to convert the image with about 50 different methods. | size (height/width) of resulting image | MATRIX,IMAGE

### Arrange

In the arrange dialog you can specify how to arrange plots on the worksheet. With 2x2 the plots are arranged in a 2x2 grid with a distance of gap between them and the border of the worksheet.

### Overlay

In the overlay dialog you can simply overlay a plot onto another. Of course you need to have at least two plots in a worksheet to use this.

### QSA Workbench

LabPlot uses the &Qt; Script for Applications (QSA) extension of &Qt; to use scripting. To create and edit scripts QSA includes the QSA workbench which can be used in LabPlot too. If LabPlot claims that it cannot find some pixmaps you can set the path to the desired pixmaps with the environment variable QSA_IMAGE_PATH. For example i use "export QSA_IMAGE_PATH=/sw/qsa-x11-free-1.1.2/src/ide/images/" before starting LabPlot.

For more informations take a look at the Scripting Chapter

## Advanced Topics

Here you will find some explanations of advanced topics.

I hope this will help to understand how to use some more advanced things in LabPlot.

### Topics

#### Errorbars

If you want to plot data with errorbars just import your data with the import dialog into a spreadsheet. Select the column X, Y and DX, DY that you want to use for errorbars. You than should select the corresponding plot (XYDY for Y errorbars, XYDXDY for X and Y errorbars and XYDYDY for 2 Y errorbars (up and down)).

If you use the data dialog to import your data directly into a plot select the correct type (x|y, x|y|dy, x|y|dx|dy or x|y|dy1|dy2) in the "read as" line edit.

#### TeX label

With version 1.5.0 LabPlot supports rendering of Tex label using texvc.

If you compile LabPlot yourself you only need a ocaml compiler present. When using a binary version of LabPlot texvc is automatically used when found in your $PATH.

For using TeX label you just have to activate the checkbox "TeX label" in the label dialog. With that every text you enter in the text box is rendered by texvc and plotted accordingly. Since this conversion takes some time you may see a certain delay when redrawing the plot.

Check out the "texlabel" example for getting a clue how it may look like.

#### Database import/export

LabPlot supports reading and writing data from a database using the KexiDB library. With KexiDB LabPlot can read and write data from PostgreSQL, mySQL, SQListe2+3. For importing data select "PostgreSQL, mySQL, etc." in the import dialog and browse through the database structure (tables and fields). For exporting data just select "DATABASE" in the export dialog and select the desired parameter.

#### multiple plots

Since version 1.3.0 LabPlot supports multiple plots on a worksheet. New plots can easily be added to a worksheet by choosing "New 2D Plot", "New 3D Plot", etc. A new plot is opened automatically when opening a function or data dialog for a plot with different type than the active plot. SO if you have an active 2d plot and select "New 3D Function" a new 3d plot is automatically added.

With the "Arrange Plots" item in the Appearance Menu you can easily arrange the plots on a worksheet. The grid for arranging the plots can be selected with numbers (like 2x2) and the distant between the plots and between a plot and the worksheet border can be set with the gap.

You can also arrange plots on a worksheet by hand. With dragging the border of a plot you can scale a plot as needed. When moving the mouse over the borders of a plot, you will see the corresponding arrows.

A whole plot can be moved by drag and drop when clicking in the center of a plot. You will see a cross arrow when reaching the center of a plot.

#### using date and time formats

When reading data in the data dialog you can specify the format for reading a column not only to double (default) but also to time and date. LabPlot uses &Qt;'s fromString() function to convert a column to a valid date or time. So it really depends on that function what date and time formats are valid. It seems, when selecting "date", the format of the column needs to be YYYY-MM-DD.

In the axes dialog you can select 3 different formats for the tic label : date, time and datetime format. With "date" selected the values are evaluated as day since 1.1.1970. With "time" selected the values are evaluated as seconds. Finally with "datetime" the values are evaluated as seconds since 1.1.1970. You can specify the shown format of the tic label by specifying a certain string in the format line edit.

Since version 1.4.0 LabPlot can import data in datetime format too. Two different formats can be selected. The text format looks like the output of "date" (locale-specific changes should be no problem) and the ISO format in the format "YYYY-MM-DDTHH:MM:SS".

#### QWT 3D Plots

Since version 1.4.0 LabPlot uses the nice library qwtplot3d to realize a more sophisticated 3 dimensional plot. For compatibility reasons the simple 3D plot is still existing and still has some advantages over the 3D plot of QWT. But i would recommend to use the QWT 3D plot when possible.

The QWT 3D plot uses OpenGL so you can easily rotate, scale and shift the plot with the mouse. In the plot settings dialog (appearance menu) you can define more settings of this 3 dimensional plot.

#### Importing Origin opj files

Since many people are using the well known OriginLab Origin program LabPlot includes the feature to import Origin opj projects from versions ranging from 4.0 up to 7.5.

The opj file format is a proprietary file format so the import filter had to be developed by using reverse engineering techniques. This is the reason why it takes a lot of work to understand and convert Origin projects. LabPlot 1.5.0 at the moment only supports Origin worksheets.

If someone is willing to give some feedback and/or help i will continue to extend the features of this import filter.

#### XML project format

&LabPlot; 1.5.1 indroduces a new project format based on XML. With some additions it should later comply with the OASIS standard.

The new XML format supports backward and forward compatibility and is much cleaner than the old LPL format. This format will be used in future releases as default project format and will replace the (old) LPL format Even though &LabPlot; will be able to read all old projects without any restriction.

## Parser functions

The &LabPlot; parser allows you to use following functions:

### standard function

Function | Description
--- | ---
acos(x) | Arc cosine
acosh(x) | Arc hyperbolic cosine
asin(x) | Arcsine
asinh(x) | Arc hyperbolic sine
atan(x) | Arctangent
atan2(y,x) | arc tangent function of two variables
atanh(x) | Arc hyperbolic tangent
beta(a,b) | Beta
cbrt(x) | Cube root
ceil(x) | Truncate upward to integer
chbevl(x, coef, N) | Evaluate Chebyshev series
chdtrc(df,x) | Complemented Chi square
chdtr(df,x) | Chi square distribution
chdtri(df,y) | Inverse Chi square
cos(x) | Cosine
cosh(x) | Hyperbolic cosine
cosm1(x) | cos(x)-1
dawsn(x) | Dawson's integral
drand() | Random value between 0..1
ellie(phi,m) | Incomplete elliptic integral (E)
ellik(phi,m) | Incomplete elliptic integral (E)
ellpe(x) | Complete elliptic integral (E)
ellpk(x) | Complete elliptic integral (K)
exp(x) | Exponential, base e
expm1(x) | exp(x)-1
expn(n,x) | Exponential integral
fabs(x) | Absolute value
fac(i) | Factorial
fdtrc(ia,ib,x) | Complemented F
fdtr(ia,ib,x) | F distribution
fdtri(ia,ib,y) | Inverse F distribution
gdtr(a,b,x) | Gamma distribution
gdtrc(a,b,x) | Complemented gamma
hyp2f1(a,b,c,x) | Gauss hypergeometric function
hyperg(a,b,x) | Confluent hypergeometric 1F1
i0(x) | Modified Bessel, order 0
i0e(x) | Exponentially scaled i0
i1(x) | Modified Bessel, order 1
i1e(x) | Exponentially scaled i1
igamc(a,x) | Complemented gamma integral
igam(a,x) | Incomplete gamma integral
igami(a,y0) | Inverse gamma integral
incbet(aa,bb,xx) | Incomplete beta integral
incbi(aa,bb,yy0) | Inverse beta integral
iv(v,x) | Modified Bessel, nonint. order
j0(x) | Bessel, order 0
j1(x) | Bessel, order 1
jn(n,x) | Bessel, order n
jv(n,x) | Bessel, noninteger order
k0(x) | Mod. Bessel, 3rd kind, order 0
k0e(x) | Exponentially scaled k0
k1(x) | Mod. Bessel, 3rd kind, order 1
k1e(x) | Exponentially scaled k1
kn(nn,x) | Mod. Bessel, 3rd kind, order n
lbeta(a,b) | Natural log of |beta|
ldexp(x,exp) | multiply floating-point number by integral power of 2
log(x) | Logarithm, base e
log10(x) | Logarithm, base 10
logb(x) | radix-independant exponent
log1p(x) | log(1+x)
ndtr(x) | Normal distribution
ndtri(x) | Inverse normal distribution
pdtrc(k,m) | Complemented Poisson
pdtr(k,m) | Poisson distribution
pdtri(k,y) | Inverse Poisson distribution
pow(x,y) | power function
psi(x) | Psi (digamma) function
rand() | Random value between 0..RAND_MAX
random() | Random value between 0..RAND_MAX
rgamma(x) | Reciprocal Gamma
rint(x) | round to nearest integer
sin(x) | Sine
sinh(x) | Hyperbolic sine
spence(x) | Dilogarithm
sqrt(x) | Square root
stdtr(k,t) | Student's t distribution
stdtri(k,p) | Inverse student's t distribution
struve(v,x) | Struve function
tan(x) | Tangent
tanh(x) | Hyperbolic tangent
true_gamma(x) | true gamma
y0(x) | Bessel, second kind, order 0
y1(x) | Bessel, second kind, order 1
yn(n,x) | Bessel, second kind, order n
yv(v,x) | Bessel, noninteger order
zeta(x,y) | Riemann Zeta function
zetac(x) | Two argument zeta function

### GSL special function

For more information about the functions see the documentation of GSL.

Function | Description
--- | ---
gsl_log1p(x) | log(1+x)
gsl_expm1(x) | exp(x)-1
gsl_hypot(x,y) | sqrt{x^2 + y^2}
gsl_acosh(x) | arccosh(x)
gsl_asinh(x) | arcsinh(x)
gsl_atanh(x) | arctanh(x)
airy_Ai(x) | Airy function Ai(x)
airy_Bi(x) | Airy function Bi(x)
airy_Ais(x) | scaled version of the Airy function S_A(x) Ai(x)
airy_Bis(x) | scaled version of the Airy function S_B(x) Bi(x)
airy_Aid(x) | Airy function derivative Ai'(x)
airy_Bid(x) | Airy function derivative Bi'(x)
airy_Aids(x) | derivative of the scaled Airy function S_A(x) Ai(x)
airy_Bids(x) | derivative of the scaled Airy function S_B(x) Bi(x)
airy_0_Ai(s) | s-th zero of the Airy function Ai(x)
airy_0_Bi(s) | s-th zero of the Airy function Bi(x)
airy_0_Aid(s) | s-th zero of the Airy function derivative Ai'(x)
airy_0_Bid(s) | s-th zero of the Airy function derivative Bi'(x)
bessel_JJ0(x) | regular cylindrical Bessel function of zeroth order, J_0(x)
bessel_JJ1(x) | regular cylindrical Bessel function of first order, J_1(x)
bessel_Jn(n,x) | regular cylindrical Bessel function of order n, J_n(x)
bessel_YY0(x) | irregular cylindrical Bessel function of zeroth order, Y_0(x)
bessel_YY1(x) | irregular cylindrical Bessel function of first order, Y_1(x)
bessel_Yn(n,x) | irregular cylindrical Bessel function of order n, Y_n(x)
bessel_I0(x) | regular modified cylindrical Bessel function of zeroth order, I_0(x)
bessel_I1(x) | regular modified cylindrical Bessel function of first order, I_1(x)
bessel_In(n,x) | regular modified cylindrical Bessel function of order n, I_n(x)
bessel_II0s(x) | scaled regular modified cylindrical Bessel function of zeroth order, exp (-|x|) I_0(x)
bessel_II1s(x) | scaled regular modified cylindrical Bessel function of first order, exp(-|x|) I_1(x)
bessel_Ins(n,x) | scaled regular modified cylindrical Bessel function of order n, exp(-|x|) I_n(x)
bessel_K0(x) | irregular modified cylindrical Bessel function of zeroth order, K_0(x)
bessel_K1(x) | irregular modified cylindrical Bessel function of first order, K_1(x)
bessel_Kn(n,x) | irregular modified cylindrical Bessel function of order n, K_n(x)
bessel_KK0s(x) | scaled irregular modified cylindrical Bessel function of zeroth order, exp (x) K_0(x)
bessel_KK1s(x) | scaled irregular modified cylindrical Bessel function of first order, exp(x) K_1(x)
bessel_Kns(n,x) | scaled irregular modified cylindrical Bessel function of order n, exp(x) K_n(x)
bessel_j0(x) | regular spherical Bessel function of zeroth order, j_0(x)
bessel_j1(x) | regular spherical Bessel function of first order, j_1(x)
bessel_j2(x) | regular spherical Bessel function of second order, j_2(x)
bessel_jl(l,x) | regular spherical Bessel function of order l, j_l(x)
bessel_y0(x) | irregular spherical Bessel function of zeroth order, y_0(x)
bessel_y1(x) | irregular spherical Bessel function of first order, y_1(x)
bessel_y2(x) | irregular spherical Bessel function of second order, y_2(x)
bessel_yl(l,x) | irregular spherical Bessel function of order l, y_l(x)
bessel_i0s(x) | scaled regular modified spherical Bessel function of zeroth order, exp(-|x|) i_0(x)
bessel_i1s(x) | scaled regular modified spherical Bessel function of first order, exp(-|x|) i_1(x)
bessel_i2s(x) | scaled regular modified spherical Bessel function of second order, exp(-|x|) i_2(x)
bessel_ils(l,x) | scaled regular modified spherical Bessel function of order l, exp(-|x|) i_l(x)
bessel_k0s(x) | scaled irregular modified spherical Bessel function of zeroth order, exp(x) k_0(x)
bessel_k1s(x) | scaled irregular modified spherical Bessel function of first order, exp(x) k_1(x)
bessel_k2s(x) | scaled irregular modified spherical Bessel function of second order, exp(x) k_2(x)
bessel_kls(l,x) | scaled irregular modified spherical Bessel function of order l, exp(x) k_l(x)
bessel_Jnu(nu,x) | regular cylindrical Bessel function of fractional order nu, J_\nu(x)
bessel_Ynu(nu,x) | irregular cylindrical Bessel function of fractional order nu, Y_\nu(x)
bessel_Inu(nu,x) | regular modified Bessel function of fractional order nu, I_\nu(x)
bessel_Inus(nu,x) | scaled regular modified Bessel function of fractional order nu, exp(-|x|) I_\nu(x)
bessel_Knu(nu,x) | irregular modified Bessel function of fractional order nu, K_\nu(x)
bessel_lnKnu(nu,x) | logarithm of the irregular modified Bessel function of fractional order nu,ln(K_\nu(x))
bessel_Knus(nu,x) | scaled irregular modified Bessel function of fractional order nu, exp(|x|) K_\nu(x)
bessel_0_J0(s) | s-th positive zero of the Bessel function J_0(x)
bessel_0_J1(s) | s-th positive zero of the Bessel function J_1(x)
bessel_0_Jnu(nu,s) | s-th positive zero of the Bessel function J_nu(x)
clausen(x) | Clausen integral Cl_2(x)
hydrogenicR_1(Z,R) | lowest-order normalized hydrogenic bound state radial wavefunction R_1 := 2Z \sqrt{Z} \exp(-Z r)
hydrogenicR(n,l,Z,R) | n-th normalized hydrogenic bound state radial wavefunction
dawson(x) | Dawson's integral
debye_1(x) | first-order Debye function D_1(x) = (1/x) \int_0^x dt (t/(e^t - 1))
debye_2(x) | second-order Debye function D_2(x) = (2/x^2) \int_0^x dt (t^2/(e^t - 1))
debye_3(x) | third-order Debye function D_3(x) = (3/x^3) \int_0^x dt (t^3/(e^t - 1))
debye_4(x) | fourth-order Debye function D_4(x) = (4/x^4) \int_0^x dt (t^4/(e^t - 1))
dilog(x) | dilogarithm
ellint_Kc(k) | complete elliptic integral K(k)
ellint_Ec(k) | complete elliptic integral E(k)
ellint_F(phi,k) | incomplete elliptic integral F(phi,k)
ellint_E(phi,k) | incomplete elliptic integral E(phi,k)
ellint_P(phi,k,n) | incomplete elliptic integral P(phi,k,n)
ellint_D(phi,k,n) | incomplete elliptic integral D(phi,k,n)
ellint_RC(x,y) | incomplete elliptic integral RC(x,y)
ellint_RD(x,y,z) | incomplete elliptic integral RD(x,y,z)
ellint_RF(x,y,z) | incomplete elliptic integral RF(x,y,z)
ellint_RJ(x,y,z) | incomplete elliptic integral RJ(x,y,z,p)
gsl_erf(x) | error function erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2)
gsl_erfc(x) | complementary error function erfc(x) = 1 - erf(x) = (2/\sqrt(\pi)) \int_x^\infty \exp(-t^2)
log_erfc(x) | logarithm of the complementary error function \log(\erfc(x))
erf_Z(x) | Gaussian probability function Z(x) = (1/(2\pi)) \exp(-x^2/2)
erf_Q(x) | upper tail of the Gaussian probability function Q(x) = (1/(2\pi)) \int_x^\infty dt \exp(-t^2/2)
gsl_exp(x) | exponential function
exprel(x) | (exp(x)-1)/x using an algorithm that is accurate for small x
exprel_2(x) | 2(exp(x)-1-x)/x^2 using an algorithm that is accurate for small x
exprel_n(n,x) | n-relative exponential, which is the n-th generalization of the functions `gsl_sf_exprel'
exp_int_E1(x) | exponential integral E_1(x), E_1(x) := Re \int_1^\infty dt \exp(-xt)/t
exp_int_E2(x) | second-order exponential integral E_2(x), E_2(x) := \Re \int_1^\infty dt \exp(-xt)/t^2
exp_int_Ei(x) | exponential integral E_i(x), Ei(x) := PV(\int_{-x}^\infty dt \exp(-t)/t)
shi(x) | Shi(x) = \int_0^x dt sinh(t)/t
chi(x) | integral Chi(x) := Re[ gamma_E + log(x) + \int_0^x dt (cosh[t]-1)/t]
expint_3(x) | exponential integral Ei_3(x) = \int_0^x dt exp(-t^3) for x >= 0
si(x) | Sine integral Si(x) = \int_0^x dt sin(t)/t
ci(x) | Cosine integral Ci(x) = -\int_x^\infty dt cos(t)/t for x > 0
atanint(x) | Arctangent integral AtanInt(x) = \int_0^x dt arctan(t)/t
fermi_dirac_m1(x) | complete Fermi-Dirac integral with an index of -1, F_{-1}(x) = e^x / (1 + e^x)
fermi_dirac_0(x) | complete Fermi-Dirac integral with an index of 0, F_0(x) = \ln(1 + e^x)
fermi_dirac_1(x) | complete Fermi-Dirac integral with an index of 1, F_1(x) = \int_0^\infty dt (t /(\exp(t-x)+1))
fermi_dirac_2(x) | complete Fermi-Dirac integral with an index of 2, F_2(x) = (1/2) \int_0^\infty dt (t^2 /(\exp(t-x)+1))
fermi_dirac_int(j,x) | complete Fermi-Dirac integral with an index of j, F_j(x) = (1/Gamma(j+1)) \int_0^\infty dt (t^j /(exp(t-x)+1))
fermi_dirac_mhalf(x) | complete Fermi-Dirac integral F_{-1/2}(x)
fermi_dirac_half(x) | complete Fermi-Dirac integral F_{1/2}(x)
fermi_dirac_3half(x) | complete Fermi-Dirac integral F_{3/2}(x)
fermi_dirac_inc_0(x,b) | incomplete Fermi-Dirac integral with an index of zero, F_0(x,b) = \ln(1 + e^{b-x}) - (b-x)
gamma(x) | Gamma function
lngamma(x) | logarithm of the Gamma function
gammastar(x) | regulated Gamma Function \Gamma^*(x) for x > 0
gammainv(x) | reciprocal of the gamma function, 1/Gamma(x) using the real Lanczos method.
taylorcoeff(n,x) | Taylor coefficient x^n / n! for x >= 0
fact(n) | factorial n!
doublefact(n) | double factorial n!! = n(n-2)(n-4)...
lnfact(n) | logarithm of the factorial of n, log(n!)
lndoublefact(n) | logarithm of the double factorial log(n!!)
choose(n,m) | combinatorial factor `n choose m' = n!/(m!(n-m)!)
lnchoose(n,m) | logarithm of `n choose m'
poch(a,x) | Pochhammer symbol (a)_x := \Gamma(a + x)/\Gamma(x)
lnpoch(a,x) | logarithm of the Pochhammer symbol (a)_x := \Gamma(a + x)/\Gamma(x)
pochrel(a,x) | relative Pochhammer symbol ((a,x) - 1)/x where (a,x) = (a)_x := \Gamma(a + x)/\Gamma(a)
gamma_inc_Q(a,x) | normalized incomplete Gamma Function P(a,x) = 1/Gamma(a) \int_x\infty dt t^{a-1} exp(-t) for a > 0, x >= 0
gamma_inc_P(a,x) | complementary normalized incomplete Gamma Function P(a,x) = 1/Gamma(a) \int_0^x dt t^{a-1} exp(-t) for a > 0, x >= 0
gsl_beta(a,b) | Beta Function, B(a,b) = Gamma(a) Gamma(b)/Gamma(a+b) for a > 0, b > 0
lnbeta(a,b) | logarithm of the Beta Function, log(B(a,b)) for a > 0, b > 0
betainc(a,b,x) | normalize incomplete Beta function B_x(a,b)/B(a,b) for a > 0, b > 0
gegenpoly_1(lambda,x) | Gegenbauer polynomial C^{lambda}_1(x)
gegenpoly_2(lambda,x) | Gegenbauer polynomial C^{lambda}_2(x)
gegenpoly_3(lambda,x) | Gegenbauer polynomial C^{lambda}_3(x)
gegenpoly_n(n,lambda,x) | Gegenbauer polynomial C^{lambda}_n(x)
hyperg_0F1(c,x) | hypergeometric function 0F1(c,x)
hyperg_1F1i(m,n,x) | confluent hypergeometric function 1F1(m,n,x) = M(m,n,x) for integer parameters m, n
hyperg_1F1(a,b,x) | confluent hypergeometric function 1F1(m,n,x) = M(m,n,x) for general parameters a,b
hyperg_Ui(m,n,x) | confluent hypergeometric function U(m,n,x) for integer parameters m,n
hyperg_U(a,b,x) | confluent hypergeometric function U(a,b,x)
hyperg_2F1(a,b,c,x) | Gauss hypergeometric function 2F1(a,b,c,x)
hyperg_2F1c(ar,ai,c,x) | Gauss hypergeometric function 2F1(a_R + i a_I, a_R - i a_I, c, x) with complex parameters
hyperg_2F1r(ar,ai,c,x) | renormalized Gauss hypergeometric function 2F1(a,b,c,x) / Gamma(c)
hyperg_2F1cr(ar,ai,c,x) | renormalized Gauss hypergeometric function 2F1(a_R + i a_I, a_R - i a_I, c, x) / Gamma(c)
hyperg_2F0(a,b,x) | hypergeometric function 2F0(a,b,x)
laguerre_1(a,x) | generalized Laguerre polynomials L^a_1(x)
laguerre_2(a,x) | generalized Laguerre polynomials L^a_2(x)
laguerre_3(a,x) | generalized Laguerre polynomials L^a_3(x)
lambert_W0(x) | principal branch of the Lambert W function, W_0(x)
lambert_Wm1(x) | secondary real-valued branch of the Lambert W function, W_{-1}(x)
legendre_P1(x) | Legendre polynomials P_1(x)
legendre_P2(x) | Legendre polynomials P_2(x)
legendre_P3(x) | Legendre polynomials P_3(x)
legendre_Pl(l,x) | Legendre polynomials P_l(x)
legendre_Q0(x) | Legendre polynomials Q_0(x)
legendre_Q1(x) | Legendre polynomials Q_1(x)
legendre_Ql(l,x) | Legendre polynomials Q_l(x)
legendre_Plm(l,m,x) | associated Legendre polynomial P_l^m(x)
legendre_sphPlm(l,m,x) | normalized associated Legendre polynomial $\sqrt{(2l+1)/(4\pi)} \sqrt{(l-m)!/(l+m)!} P_l^m(x)$ suitable for use in spherical harmonics
conicalP_half(lambda,x) | irregular Spherical Conical Function P^{1/2}_{-1/2 + i \lambda}(x) for x > -1
conicalP_mhalf(lambda,x) | regular Spherical Conical Function P^{-1/2}_{-1/2 + i \lambda}(x) for x > -1
conicalP_0(lambda,x) | conical function P^0_{-1/2 + i \lambda}(x) for x > -1
conicalP_1(lambda,x) | conical function P^1_{-1/2 + i \lambda}(x) for x > -1
conicalP_sphreg(l,lambda,x) | Regular Spherical Conical Function P^{-1/2-l}_{-1/2 + i \lambda}(x) for x > -1, l >= -1
conicalP_cylreg(l,lambda,x) | Regular Cylindrical Conical Function P^{-m}_{-1/2 + i \lambda}(x) for x > -1, m >= -1
legendre_H3d_0(lambda,eta) | zeroth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space, L^{H3d}_0(lambda,eta) := sin(lambda eta)/(lambda sinh(eta)) for eta >= 0
legendre_H3d_1(lambda,eta) | zeroth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space, L^{H3d}_1(lambda,eta) := 1/sqrt{lambda^2 + 1} sin(lambda eta)/(lambda sinh(eta)) (coth(eta) - lambda cot(lambda eta)) for eta >= 0
legendre_H3d(l,lambda,eta) | L'th radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space eta >= 0, l >= 0
gsl_log(x) | logarithm of X
loga(x) | logarithm of the magnitude of X, log(|x|)
logp(x) | log(1 + x) for x > -1 using an algorithm that is accurate for small x
logm(x) | log(1 + x) - x for x > -1 using an algorithm that is accurate for small x
gsl_pow(x,n) | power x^n for integer n
psii(n) | digamma function psi(n) for positive integer n
psi(x) | digamma function psi(n) for general x
psiy(y) | real part of the digamma function on the line 1+i y, Re[psi(1 + i y)]
ps1i(n) | Trigamma function psi'(n) for positive integer n
ps_n(m,x) | polygamma function psi^{(m)}(x) for m >= 0, x > 0
synchrotron_1(x) | first synchrotron function x \int_x^\infty dt K_{5/3}(t) for x >= 0
synchrotron_2(x) | second synchrotron function x K_{2/3}(x) for x >= 0
transport_2(x) | transport function J(2,x)
transport_3(x) | transport function J(3,x)
transport_4(x) | transport function J(4,x)
transport_5(x) | transport function J(5,x)
hypot(x,y) | hypotenuse function \sqrt{x^2 + y^2}
sinc(x) | sinc(x) = sin(pi x) / (pi x)
lnsinh(x) | log(sinh(x)) for x > 0
lncosh(x) | log(cosh(x))
zetai(n) | Riemann zeta function zeta(n) for integer N
gsl_zeta(s) | Riemann zeta function zeta(s) for arbitrary s
hzeta(s,q) | Hurwitz zeta function zeta(s,q) for s > 1, q > 0
etai(n) | eta function eta(n) for integer n
eta(s) | eta function eta(s) for arbitrary s

### GSL random number distributions

For more information about the functions see the documentation of GSL.

Function | Description
--- | ---
gaussian(x,sigma) | probability density p(x) at X for a Gaussian distribution with standard deviation SIGMA
ugaussian(x) | unit Gaussian distribution. They are equivalent to the functions above with a standard deviation of one, SIGMA = 1
gaussian_tail(x,a,sigma) | probability density p(x) at X for a Gaussian tail distribution with standard deviation SIGMA and lower limit A
ugaussian_tail(x,a) | tail of a unit Gaussian distribution. They are equivalent to the functions above with a standard deviation of one, SIGMA = 1
bivariate_gaussian(x,y,sigma_x,sigma_y,rho) | probability density p(x,y) at (X,Y) for a bivariate gaussian distribution with standard deviations SIGMA_X, SIGMA_Y and correlation coefficient RHO
exponential(x,mu) | probability density p(x) at X for an exponential distribution with mean MU
laplace(x,a) | probability density p(x) at X for a Laplace distribution with mean A
exppow(x,a,b) | probability density p(x) at X for an exponential power distribution with scale parameter A and exponent B
cauchy(x,a) | probability density p(x) at X for a Cauchy distribution with scale parameter A
rayleigh(x,sigma) | probability density p(x) at X for a Rayleigh distribution with scale parameter SIGMA
rayleigh_tail(x,a,sigma) | probability density p(x) at X for a Rayleigh tail distribution with scale parameter SIGMA and lower limit A
landau(x) | probability density p(x) at X for the Landau distribution
gamma_pdf(x,a,b) | probability density p(x) at X for a gamma distribution with parameters A and B
flat(x,a,b) | probability density p(x) at X for a uniform distribution from A to B
lognormal(x,zeta,sigma) | probability density p(x) at X for a lognormal distribution with parameters ZETA and SIGMA
chisq(x,nu) | probability density p(x) at X for a chi-squared distribution with NU degrees of freedom
fdist(x,nu1,nu2) | probability density p(x) at X for an F-distribution with NU1 and NU2 degrees of freedom
tdist(x,nu) | probability density p(x) at X for a t-distribution with NU degrees of freedom
beta_pdf(x,a,b) | probability density p(x) at X for a beta distribution with parameters A and B
logistic(x,a) | probability density p(x) at X for a logistic distribution with scale parameter A
pareto(x,a,b) | probability density p(x) at X for a Pareto distribution with exponent A and scale B
weibull(x,a,b) | probability density p(x) at X for a Weibull distribution with scale A and exponent B
gumbel1(x,a,b) | probability density p(x) at X for a Type-1 Gumbel distribution with parameters A and B
gumbel2(x,a,b) | probability density p(x) at X for a Type-2 Gumbel distribution with parameters A and B
poisson(k,mu) | probability p(k) of obtaining K from a Poisson distribution with mean mu
bernoulli(k,p) | probability p(k) of obtaining K from a Bernoulli distribution with probability parameter P
binomial(k,p,n) | probability p(k) of obtaining K from a binomial distribution with parameters P and N
negative_binomial(k,p,n) | probability p(k) of obtaining K from a negative binomial distribution with parameters P and N
pascal(k,p,n) | probability p(k) of obtaining K from a Pascal distribution with parameters P and N
geometric(k,p) | probability p(k) of obtaining K from a geometric distribution with probability parameter P
hypergeometric(k,n1,n2,t) | probability p(k) of obtaining K from a hypergeometric distribution with parameters N1, N2, N3
logarithmic(k,p) | probability p(k) of obtaining K from a logarithmic distribution with probability parameter P

### constants

Constant | Description
--- | ---
PI1 | 1/pi
PI2 | 2/pi
PISQRT2 | 2/sqrt(pi)
E | e
LN2 | log_e 2
LN10 | log_e 10
LOG2E | log_2 e
LOG10E | log_10 e
PI | pi
PI_2 | pi/2
PI_4 | pi/4
SQRT2 | sqrt(2)
SQRT1_2 | 1/sqrt(2)

### GSL constants

For more information about this constants see the documentation of GSL.

Constant | Description
--- | ---
c | The speed of light in vacuum
mu0 | The permeability of free space
e0 | The permittivity of free space
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
Gauss | The magnetic field of 1 Gauss
mu | The length of 1 micron
ha | The area of 1 hectare
mph | The speed of 1 mile per hour
kmh | The speed of 1 kilometer per hour
au | The length of 1 astronomical unit (mean earth-sun distance)
G | The gravitational constant
ly | The distance of 1 light-year
pc | The distance of 1 parsec
g | The standard gravitational acceleration on Earth
ms | The mass of the Sun
e | 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
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
mile | The length of 1 mile
mil | The length of 1 mil (1/1000th of an inch)
nmile | The length of 1 nautical mile
fathom | The length of 1 fathom
knot | The speed of 1 knot
pt | The length of 1 printer's point (1/72 inch)
texpt | The length of 1 TeX point (1/72.27 inch)
acre | The area of 1 acre
ltr | The volume of 1 liter
us_gallon | The volume of 1 US gallon
can_gallon | The volume of 1 Canadian gallon
uk_gallon | The volume of 1 UK gallon
quart | The volume of 1 quart
pint | The volume of 1 pint
pound | The mass of 1 pound
ounce | The mass of 1 ounce
ton | The mass of 1 ton
mton | The mass of 1 metric ton (1000 kg)
uk_ton | The mass of 1 UK ton
troy_ounce | The mass of 1 troy ounce
carat | The mass of 1 carat
gram_force | The force of 1 gram weight
pound_force | The force of 1 pound weight
kilepound_force | The force of 1 kilopound weight
poundal | The force of 1 poundal
cal | The energy of 1 calorie
btu | The energy of 1 British Thermal Unit
therm | The energy of 1 Therm
hp | The power of 1 horsepower
bar | The pressure of 1 bar
atm | The pressure of 1 standard atmosphere
torr | The pressure of 1 torr
mhg | The pressure of 1 meter of mercury
inhg | The pressure of 1 inch of mercury
inh2o | The pressure of 1 inch of water
psi | The pressure of 1 pound per square inch
poise | The dynamic viscosity of 1 poise
stokes | The kinematic viscosity of 1 stokes
stilb | The luminance of 1 stilb
lumen | The luminous flux of 1 lumen
lux | The illuminance of 1 lux
phot | The illuminance of 1 phot
ftcandle | The illuminance of 1 footcandle
lambert | The luminance of 1 lambert
ftlambert | The luminance of 1 footlambert
curie | The activity of 1 curie
roentgen | The exposure of 1 roentgen
rad | The absorbed dose of 1 rad

The following constants are the same constants in cgs system :

Constant | Description
--- | ---
c_cgs
G_cgs
h_cgs
hbar_cgs
mu0_cgs
au_cgs
ly_cgs
pc_cgs
g_cgs
eV_cgs
me_cgs
mmu_cgs
mp_cgs
mn_cgs
Ry_cgs
k_cgs
muB_cgs
muN_cgs
mue_cgs
mup_cgs
R0_cgs
V0_cgs
in_cgs
ft_cgs
yard_cgs
mile_cgs
nile_cgs
fathom_cgs
mil_cgs
pt_cgs
texpt_cgs
mu_cgs
A_cgs
ha_cgs
acre_cgs
barn_cgs
ltr_cgs
us_gallon-cgs
quart_cgs
pint_cgs
cup_cgs
fluid_ouncs_cgs
tablespoon_cgs
teaspoon_cgs
can_gallon_cgs
uk_gallon_cgs
mph_cgs
kmh_cgs
knot_cgs
pound_cgs
ouncs_cgs
ton_cgs
mton_cgs
uk_ton_cgs
troy_ounce_cgs
carat_cgs
amu_cgs
gram_cgs
pound_force_cgs
kilopound_force_cgs
poundal_cgs
cal_cgs
btu_cgs
therm_cgs
hp_cgs
bar_cgs
atm_cgs
torr_cgs
mhg_cgs
inhg_cgs
inh2o_cgs
psi_cgs
poise_cgs
stokes_cgs
F_cgs
e_cgs
G_cgs
stilb_cgs
lumen_cgs
lux_cgs
phot_cgs
ftcandle_cgs
lambert_cgs
ftlambert_cgs
curie_cgs
roentgen_cgs
rad_cgs
sm_cgs
a0_cgs
e0_cgs

## Scripting

This chapter explains the scripting interface of LabPlot that can help you to automate your work. With the use of the scripting interface you can get very productive and simplify your work when doing the same things often. With the knowledge of this interface you are able to completely control LabPlot remotely .

### QSA

LabPlot uses &Qt; Script for Applications (QSA) developed by Trolltech, Inc. It is released under two different licenses - one commercial (that costs an arm and a leg) and the other GPL (free for download). The GPL version has some restrictions that are applicable to the case of a commercially developed application.

Of course LabPlot needs to be build with QSA support. For &kde; 3 (based on &Qt; 3) you need version 1.1.X of QSA.

#### Using Scripts

Scripts are small files that contain instructions to be executed. Since LabPlot can interpret such scripts it can be automated using this. Scripts can be created and edited with your favorite text editor or by using the QSA Workbench (Can be found in the LabPlot menu under "Script->QSA Workbench..."). If the icons in the Workbench are missing check out the Workbench Chapter.

To execute a script you can call ``LabPlot` script.qs` from the commandline or drag and drop a script on the desktop into LabPlot. You can also use the dialog "Script->Open Script" in LabPlot to execute a script.

LabPlot is divided into a bunch of classes. For most scripting needs, you need to know only a few of them. For every operation you just call the corresponding function on the LabPlot classes. All available functions can be found in the classes reference at http://cvs.sourceforge.net/viewcvs.py/*checkout*/labplot/doc/html/hierarchy.html.

All MainWin functions can be called directly. Let start with

    importData("sample.dat");

This simply imports the data file "sample.dat" into a Spreadsheet in LabPlot. You can see it in the screenshot. import import

If you now want to work with the Spreadsheet you have to call the corresponding Spreadsheet function. Let's say we want to make a 2D Plot

    importData("sample.dat");
    s = activeSpreadsheet();
    s.plot2DSimple();

The result is plot from spreadsheet plot Now we want to work on the Plot. We have to get the Worksheet and the active Plot of it. The script looks like that:

    importData("sample.dat");
    s = activeSpreadsheet();
    s.plot2DSimple();
    w = activeWorksheet();
    p = w.get2DPlot(w.API());
    p.setBackground("green");
    w.redraw();

With the result that we have a green background work on plot green

A complete script that imports data and changes some settings before saving the result as EPS would look like this:

    importData("sample-data/sin.dat");

    s = activeSpreadsheet();
    s.plot2DSimple();

    w = activeWorksheet();
    p = w.get2DPlot(w.API());

    p.setBackground("green");
    p.setGraphBackground("lightblue");

    r = p.ActRange(0);
    r.setRange(250,750);
    r = p.ActRange(1);
    r.setRange(-2,2);

    l = p.getLegend();
    l.setPosition(.5,.4);

    t = p.Title();
    t.setTitle("example title");
    t.setRotation(10);

    a = p.getAxis(0);
    a.enableMajorGrid();
    ll = a.getLabel();
    ll.setTitle("different x axis");
    font = new Font("SanSerif");
    a.setTickLabelFont(font);

    p.setMarksEnabled();
    mark = p.markX();
    mark.setRange(450,550);

    p.setRegionEnabled();
    p.setRegion(350,650);

    // w.redraw();

    exportEPS("export.eps");
    exit();

The used functions should be quite self-explanatory. the resulting EPS then looks like that complete session session

This is basically all you need to know about writing scripts. More examples can be found in the directory examples/scripts/ of the source distribution or in the data directory of LabPlot.

#### Specials

For a detailed description of the QSA syntax check out the QSA documentation. All enumerations available in &LabPlot; can also be used in Scripts, check out the global script labplot.qs.

With QSA it is also possible to use dialogs to enter filenames, etc. . The following example uses a dialog to enter a data file name:

    d = new ImportDialog();

    var filename = FileDialog.getOpenFileName( "*.dat" );
    if (filename) {
            d.setFilename(filename);
            d.Apply();
    }

## Examples

In this chapter you will find explanations of the example projects of LabPlot. You can find all the examples under Help->Examples except specified

### Example Projects for LabPlot

Screenshot | Name | Description
| axes label | this example shows how to use different axes label. The shown function is filled to the baseline.
| rydberg spectra | this example shows a Rydberg spectra measured by photoexcitation of metastable helium in a magneto optical trap.
| log axis scale | this example uses logarithmic axis scales with custom tic label
| audio data | this example shows data read from an audio file
| marker | this example shows a usage of marker
| TeX label | this example uses a TeX label
| analysis | this example shows the difference between the three analysis functions prune, average and smooth. Here you can see different styles and symbols for showing data.
| simple fft | this example shows how a simple fourier transform might look like.
| histogram | this example shows a sample histogram of a periodic function.
| nonlinear fitting | this example shows a nonlinear lorentzian fit of a sample data set in a specified region.
| exponential fit | this example shows how an exponential fit of sample data should look like.
| log fit | this example shows an exponential fit inside a logarithmic plot.
| surface | this example shows a simple surface plot with density and contour plot of a used defined function. The color palette is chosen to nicely show the function values.
| surface style | this example shows the same data set as surface plot in different styles.
| 3d | this example shows a simple 3 dimensional plot created from a function.
| drawing objects | this example shows how to use drawing objects in LabPlot.
| images | this example shows a surface plot created from an image file (utm.xpm).
| pie plot | this example shows a simple pie plot created from two dimensional data
| bar plot | this example shows the usage of the bar style for x and y ranges.
| multiple plots | this example shows the usage of multiple plots per worksheet. Here you can s see four different types of plot arranged 2x2 with gap=0.05.
| qwt 3d plot | this example shows the usage of a qwt 3 dimensional plot. This example uses a customized colormap and the "flooriso" style to make the contour lines on the floor.
| another surface plot | this is another example for a surface plot. This example shows how logarithmic axis scales can be used her too.
| polar plot | this example shows a simple polar plot created from functions
| ternary plot | this example shows a ternary plot created with some data
| sfi (only on download site) | this example introduces overlayed plots by showing a selective field ionization spectra overlayed with the field ramp.

## Known Bugs

### Known Bugs

Here you find a list of known bugs. For a more detailed list please take a look at the TODO file in the LabPlot package.

pstoedit sometimes doesn't work correct.

pstoedit has sometimes problems when converting postscript files created by &Qt;. Especially with truetype fonts &Qt; seems to create corrupted postscript files. These postscript files may look good when using ghostscript but fail when converting them with pstoedit.

I haven't found a solution for this problem and finally changed the standard fonts of LabPlot to use fonts that produces no problems with pstoedit. I hope this get fixed in a future release of &Qt;.

LabPlot crashes on SuSE 9.0 on startup.

The original &Qt; package of SuSE 9.0 has a bug when rotating text. So all applications using this library to rotate text are crashing. SuSE provides an updated &Qt; package for SuSE 9.0 on their website. So please update the &Qt; package.

Unfortunately the text rotation of &Qt; on SuSE 9.0 still has a bug so that the single letters of a string are not rotated. To fix this you should update to SuSE 9.1 on which &Qt; text rotation works perfectly.

ImageMagick can't be used on FreeBSD 4-stable.

When compiling LabPlot on FreeBSD 4-stable and you have ImageMagick there seems to be a problem that only appears on FreeBSD 4 :

/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined

I have no idea what the problem is. If someone can fix this please send me a note. By now the only thing to do is to deactivate ImageMagick (--disable-ImageMagick) when compiling.

When using the KPart object of LabPlot the window can't be resized.

When resizing the window to the desired size please reload the page with the KPart. That should fix this bug.

## Questions and Answers

For which platforms is LabPlot available?

LabPlot is developed for Unix platforms and uses the &Qt; toolkit and &kde;. Normally you can expect LabPlot to build and run on every platform &kde; (>=3) supports. A recent list of supported platforms and tips for compiling and running LabPlot can be found on http://labplot.sf.net/wiki?Download.

I personally have access and can support the following platforms :

- SuSE 10.0 (main development platform)

- SuSE 9.3

- SuSE 9.1

- Fedora Core 4

- Fedora Core 3

- RedHat 9

- Mandriva 2006

- Mandrake 10.1

- Mandrake 10.0

- Slackware 10

With the help from some volunteers the following platforms are also known to work :

- Debian 3.0

- FreeBSD 4,5

- PLD 2.0

- CentOS 4

If you like to test and compile LabPlot on any other platform (like Solaris, Xantos, Windows, etc.), please let me know. If you encounter any problem during compilation i may be able to help.

After compiling and starting LabPlot i only see a "File" and a "Help" menu. The toolbars are completely empty. Whats wrong?

LabPlot uses the standard way for creating the graphical user interface (GUI) of &kde; applications. The GUI of LabPlot is described in the file "LabPlotui.rc" which needs to be installed in the correct &kde; path so that &kde; can build the menu, the toolbars, etc. On normal &kde; installation "./configure --prefix=$KDEDIR ; make ; make install" should put all files in the correct directories. (e.g. $KDEDIR/share/apps/LabPlot/ for "LabPlotui.rc"). Please have a look at your distribution on where to install the needed files.

It is also possible to use a user defined directory for shared files used by &kde;. This extra directories can be specified in the environment variable KDEDIRS. So when installing LabPlot under /usr/local you just need to add "/usr/local" to the KDEDIRS environment variable before starting &kde;.

How do i export the active worksheet as image?

There are three ways to export the active worksheet as image. The standard way is to use "File->Export To Image". All &Qt; supported image formats are allowed. Just select the desired format and the active worksheet is exported. The second way to export as an image is to use "File->Export via pstoedit". Here the active worksheet is exported to Postscript and then internally converted to the selected format via pstoedit. A lot of non-image formats (like PDF or DXF) is supported too. You can select the image size, scale and rotation in this dialog. The third way to export to an image is to use "File->Export via ImageMagick". LabPlot uses the ImageMagick library to convert to all possible image formats (over 200 image formats are supported by ImageMagick). Like in "Export via pstoedit" you can select size, scale and rotation of the image.

Some analysis functions are not working. What can i do?

LabPlot uses the GNU Scientific Library (gsl) for regression, histograms, fourier transform and nonlinear fitting. You can use LabPlot even if you don't have the gsl installed, but you wont be able to use the above mentioned functions. So please install the gsl if you want to use this features.

How do i use greek letters for title, axes label, etc.?

LabPlot uses the font "greek times" which was available on SuSE until version 9.0. You just have to install the package xfntgreek-1.0-560.noarch.rpm to make this font available. If everything works you should be able to see the greek letters (lower and upper case) in the Label Dialog and you can use them for the label.

How do i use LabPlot objects,plots,etc. in my own application?

Since the 1.2.3 release of LabPlot all classes of LabPlot are collected in the library libLabPlot. At the moment you should have a look at the source packages for the documentation of all classes. After testing how the library can be used i will improve the documentation application programming interface (API) for the library by using doxygen. Please mail me if you have any questions. Additionally I created a KPart object for LabPlot projects so you can display and edit a LabPlot *.lpl file in your application. Please have a look at the &kde; documentation on how to use &kde; KParts objects.

I miss an important feature. What can i do?

Please take a look at the TODO file in the documentation of LabPlot. Here all planed features are listed in more or less sorted order which i will implement in future releases of LabPlot. If you like to have additional features or like to have a listed feature soon, mail me your wishes and, if possible, send me example data or a short description of what you like to do. It is not unlikely that your feature will appear in the next stable release of LabPlot :-)

I want to help. How can i contribute to LabPlot?

Yes, of course. There are a lot things to do. Even if you don't know anything about programming i always need people to find bugs, test things and make suggestions. Also the translation and documentation always needs a lot of work. Just mail me if you need any help.

## License

&LabPlot;

Program copyright 2006 Stefan Gerlach gerlach@mbi-berlin.de

Remember : &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, I need every help i can get. Any contribution like wishes, corrections, patches, bug reports or screen shots is welcome.

Documentation copyright 2006 Stefan Gerlach gerlach@mbi-berlin.de

&underFDL; &underGPL;

## Installation

### How to Obtain &LabPlot;

&LabPlot; can be found on its homepage at sourceforge.net : http://labplot.sf.net. There is an overview about all available packages at http://labplot.sf.net/wiki?Download.

### Requirements

In order to successfully use &LabPlot;, you need at least a standard &kde; 3.0 installation.

The following libraries are included in the &LabPlot; distribution :

- Cephes Math Library Release 2.3: June, 1995 : adapted from Grace for using of powerful mathematical functions (parser) [Free]

- qwtplot3d 0.2.4beta : provide OpenGL 3D plots. Used in QWT 3D plot.

- qtiffio library : support for tiff image format

- audiofile 0.2.5 : support for reading/writing audio files [LGPL]

- netcdf 3.5.0 : support for reading/writing Unidata Network Common Data Form (netCDF) files [see netcdf/COPYRIGHT]

- libundo 0.8.2 : support for Undo/Redo (not used at the moment)

Optional &LabPlot; uses following programs/libraries when available :

- GNU scientific library (GSL) : used for special functions in the parser and most of the analysis functions.

- Fastest Fourier Transform in the West (fftw or fftw3) : used for fourier transform.

- pstoedit : For exporting to *.eps,*.dxf,*.fig, etc. via pstoedit you need pstoedit installed.

- Imagemagick/ImageMagick-C++ : For exporting to more than 100 image formats you need ImageMagick++ installed.

- &Qt; Script for Applications : used for scripting and plugins for LabPlot.

- JasPer library : support for JPEG 2000 image format

- cdf : support for reading/writing Common Data Form (CDF) files

### Compilation and Installation

In order to compile and install &LabPlot; on your system type the following in the base directory of &LabPlot; distribution:

    % ./configure
    % make
    % make install

Since &LabPlot; uses autoconf and automake you should have not trouble compiling it. For many systems RPM or DEB packages are available. Please check out the download section of the &LabPlot; homepage for all supported platforms. Should you run into problems please report them to the author of &LabPlot;.