# Introduction

## What &appname; does

&appname; is a program for two- and three-dimensional graphical presentation of data sets and for data analysis. The plots can be produced from data sets stored in tables or from analytical functions.

The projet has been created by &ion; in 2000, and he was the only programmer between 2000 and 2005. Since 2006, new contributors have joined Ion and the project is hosted by BerliOS Developper. The software aims to be a tool for analysis and graphical representation of data in the way of commercial software like Origin.

&appname; is a dynamic tool, the plots created from data sets and the spreadsheets owing the data are interconected. When the spreadsheets are modified, all the objects in the depending plots (curves, axes scales, legends) are automatically updated. For example, deleting a spreadsheet or only some columns will automatically remove all the corresponding curves from the depending plots.

All settings of a complete set of tables, matrix and plots can be saved in project files, having the extention ".qti". These project files may be opened using the command line, or using the File menu, or by using the Open project icon from the File toolbar.

The plots can be exported to several graphic formats such as JPEG or png and inserted as images in documents or presentations.

Data analysis operations (integration, interpolation, FFT, curve fitting, etc...) can be performed on the curves in a 2D plot via the Analysis menu. The results of all these operations are also stored in the project files. They can be visualized at any moment using the &results-log-lnk; and can be deleted from the project file via the &clear-log-lnk;.

When the application is launched, a new untitled project file is created consisting of a grey main window (the workspace) which may contains an empty window, depending on your preferences. The type of the initial window can be customized using the Preferences dialog. It may be a table, a matrix, a note or an empty 2D graph window. In order to be operational, the workspace must be populated with tables storing data sets, either by creating empty tables/matrices first (&new-table-lnk;) and then filling them with data, or by importing ASCII files (&import-ascii-lnk;), which automatically creates new tables.

The user can easily navigate through the objects of a project file using the project explorer or the Windows menu. The project explorer also allows the user to perform various operations on the windows (tables and plots) in the workspace: hiding, minimazing, closing, renaming, printing, etc...

## Command Line Parameters

### Specify a File

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

    &appname; file_name.&file-ext;

Other file formats are also accepted: .opj, .ogm, .ogw, .ogg for Origin projects, and .qti, qti.gz for &appname; projects.

The name can also refer to an ASCII file:

    &appname; ASCII_file_name

In this latter case a new "untitled" project will be created, containing a spreadsheet with the ASCII data in the file and a 2D plot of all columns as a function of the first column in the file. You must take care of the format of the ASCII file because it will be read with the current values of the &import-ascii-lnk; dialog. These default values are:

- the default field separator is ; but it can be changed in the &preferences-lnk; dialog,

- all lines are read,

- the first line is used to name the columns,

- the spaces at the end of the lines are not removed,

- the spaces are not simplified.

### Command Line Options

Valid options are:

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

- -d or --default-settings: start &appname; with the default settings

- -h or --help: show command line options

- -l=XX or --lang=XX: start &appname; in language XX ('en', 'fr', 'de', ...)

- -m or --manual: show &appname; manual in a standalone window

- -v or --version: print &appname; version and release date

- -x or --execute: execute the script file given as argument

## General Concepts and Terms

Several plots and all the data related to these plots can be save in a project file, the project is therefore the main container of &appname;. The following screenshot gives an example of a typical session. This example shows the log panel at the top of the workspace, the project explorer at the bottom, a table and a plot window are shown while other are docked or hidden.

### A typical &appname; session

There are numerous commands available in &appname; depending on the element which is selected. Therefore, the main menu bar changes when you select a particular element of the project. Moreover, you can access to the set of commands relevant of an element by activating the context menu with the right button of the mouse.

In a project, the containers which can be used are:

A Table

  A table is a spreadsheet which can be used to store the datas you are entering. It can also be used to do some calculations and statistical analysis of datas. In each table, columns can be labelled as X-values or Y-values for 2D-plotting, or Z-values if you plan to build a 3D-plot.

  A table can be created by the &new-table-lnk;. Then there are several ways to fill the table with your data. If you want to read a table from an ASCII file, you can import the data from the file to a table with the &import-ascii-lnk;. You can also enter each value from the keyboard. The last way to enter your data is to fill the table with the results of a mathematical function (&set-column-values-lnk; from the &table-menu-lnk;)

A Matrix

  A matrix is a special table which is used to store the data points for surface 3D plots. It contains Z-values and doesn't include any column or row which could be designed as X-values or Y-values. Nevertheless, you can specify the X-values and the Y-values with the &set-dimensions-lnk; command from the &matrix-menu-lnk;.

  A matrix can be created by the &new-matrix-lnk;. If you want to read a matrix from an ASCII file, you can import the data of the file to a table with the &import-ascii-lnk; and then convert this table to a matrix with the &convert-to-matrix-lnk;. In the same way as for tables, you can also fill matrix with the results of a function z=(i,j) in which i and j are row and column numbers (&set-values-lnk; from the &matrix-menu-lnk;)

A Graph

  A graph can contain one or several plots. Each of these plots is contained in a different layer, these layers can be arranged in many ways to build matrix of plots.

  A new layer can be added to an existing graph with the &add-layer-lnk; from the &graph-menu-lnk;. you can also remove an existing layer with the &remove-layer-lnk;, but if you remove a layer, the plot will be deleted. You can also copy a layer from one graph to another. You can also copy an existing graph into another, the window will be added as a new layer (see the section on Multilayer Plots for more details).

  Plots can be created in several ways. You can select data in tables or matrix and build a plot, or create new plots from functions of one or two variables (see sections 2D plots and 3D plots).

A Note

  This window is a text container which can simply be used to insert comments into a project, but is really far more powerfull than that. It can be used as a calculator, for executing single commands and for writing scripts.

The Log Window

  This window is used to store the results of all the calculations which have been done. If this window is not visible, you can find it with the Project Explorer or with the &results-log-lnk;.

  The text in the log window is also saved in the project file, so that when you load a previously saved project, the results-log panel is re-filled with the results of the calculations.

The Project Explorer

  This window is used to list all the windows contained in a projet. The Project Explorer gives a quick access to all elements of a project, hidden or visibles. It can be used to do some operations on the windows related to these items such as hidding a window, renaming windows, etc.

  Since the version 0.8.5, a project file can include several independant projects. In this case, the containers of each project are stored in different folders.

### Tables

The table is the main part of QtiPlot when working with data. For controlling and converting data the spreadsheet contains a highly customizable table: all colors and font preferences can be set using the &preferences-lnk; of the &view-menu-lnk;. You can resize a table in terms of rows and columns using the &table-menu-lnk; with &rows-lnk; or &columns-lnk;.

#### The &appname; table

Every column of the table has a label and can be assigned a format: numeric, text, date or time. In a spreadsheet, columns can have the following flags: X, Y, Z, X-error, Y-error or can be simple columns without any special flag. The X columns are abscissae columns while the Y columns are ordinates columns used when creating a 2D plot from data. The X-error and Y-error columns can be used in order to add error bars to 2D plots. These flags can be changed using the Column options dialog. To reach this dialog you simply have to double-click on the column label or to use the &column-options-lnk; of the &table-menu-lnk;.

You can select all the columns of the spreadsheet (Ctrl+A) or only some of them by clicking on the column label while keeping the Ctrl key pressed, or by moving the mouse over the column label. This also allows you to deselect columns.

On the selected columns you can perform various operations: fill with data, normalize, sort, view statistics and finally make plots out of your data. All these functions can be reached by right clicking on the column label or by using the &table-menu-lnk;.

Any other spreadsheet function: rename, duplicate, export, print, close can be reached via the context menu (right click anywhere in the table outside the column labels area).

You can cut, copy and paste data between spreadsheets or between a spreadsheet and another application (Excel, Gnumeric, etc...).

You can import single or multiple ASCII files using the &import-ascii-lnk; from the &file-menu-lnk;. Of course you can export the data from the spreadsheet to a text file using the &export-ascii-lnk;.

### Matrix

The matrix is a special table which is used for data depending on two variables. This special table can be used to create 3D plots as well as 2D image/contour plots via the &plot3d-menu-lnk; and the &plot3d-toolbar-lnk;.

The difference between a table and a matrix is that matrices have a dual functioning mode: they can display data in a table form or they can display an image.

Therefore matrices can be used as a basic image viewer and also as an image editor, since they implement some image manipulation funcions like: 90 degrees rotation, horizontal and vertical mirroring, etc...

In matrices there is no special column nor special row for X or Y labels or values. Nevertheless, you can specify an X-scale and an Y-scale with the &set-dimensions-lnk;.

#### The &appname; matrix

The values which are stored in a matrix can be obtained from a function of the form z=f(i, j, x, y) with the &set-values-lnk;, i and j beeing the column and row numbers and x and y the corresponding coordinates.

They can also be read directly from an ASCII file with the &import-ascii-lnk; or from an image file.

### Plot Window

The plot window is the one in which the graphic is plotted. It contains at least one layer, which is the main container of the plot window. Each new plot can be inserted in a new layer of this plot window, it has its own geometry and graphic properties (background color, frame, etc). The example presented below shows a graph with two layers which have different geometries.

#### An example of &appname; 2D graph

Each layer can be activated by clicking on the corresponding gray button in the top-left corner of the window.

The elements which can be accessed by a double click in a layer are:

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

- The axes or the axes labels: this will open the General Plot Options Dialog. It is used to customize the axes, the numbers and labels of the axes, and the grid.

- Text items, including the legend of the plot: this will open the Text Options Dialog which allows to customize the font of the label and the frame in which it is drawn.

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

- Image items: this will open a dialog allowing to customize the geometry and the position of the image.

A right click on a plot element pops-up a context menu allowing fast access to its properties dialog.

Last but not least, you should know that QtiPlot provides multiple selection for arrows and images. In order to add an arrow or an image to an existing selection keep the Shift key pressed and click on the element you want to add to the selection. Elements in a multiple selection can be moved and resized together with the mouse.

### Note

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

#### The &appname; Note Window

Note windows also provide some basic text editor functionality, particularly helpful when writing scripts: they can display the line numbers and pop-up autocompletion suggestions for words that have more than two characters. You can trigger autocompletion using Ctrl+U.

You can also change the text input method. Simple Composing Input Method is the standard method to enter text in QT applications. Xim is the X input method, it is the legacy system of the X window environment to support localized text input. The default choice is the second one, it allows to enter special characters and accents from your localised environment.

### Log Window

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

#### The &appname; Log window

### The Project Explorer

The project explorer can be opened/closed using the &project-explorer-lnk; from the &view-menu-lnk; or by clicking on the &project-explorer-icon; in the file toolbar.

#### The &appname; Project Explorer

It gives an overview of the structure of a project and allows the user to perform various operations on the windows (tables and plots) in the workspace: hiding, minimazing, closing, renaming, printing, etc... These functions can be reached via the context menu, by right-clicking on an item in the explorer.

By double-clicking on an item, the corresponding window is shown maximized in the workspace, even if it was hidden before.

You can organize the differents objects in folders. When selecting a folder, the default policy is that only the objects contained in it will be showed in the workspace window. You can also display all the objects in the subfolders if you change this policy with the "View Windows" command to "Windows in Active Folder and Subfolders".