Humboldt-Universität zu Berlin - Mathematisch-Naturwissen­schaft­liche Fakultät - Institut für Physik

QtiPlot - Installation Notes and FAQ

Visit QtiPlot webpage

License:

QtiPlot is distributed under the GNU General Public License. Thus it is "free software". "Free software" is a matter of liberty, not price. To understand the concept, you should think of "free" as in "free speech", not as in "free beer". "Free software" is also often called Open Source, FOSS, or FLOSS.

General requirements:

You need to install the following libraries: Qt (>= 4.5.0), GSL, muParser (1.28), zlib, libpng and BOOST C++ libraries.

The QtiPlot developers also work very actively on the liborigin2 library. The development version of this library is shipped with QtiPlot in the "3rdparty" folder and does not need to be compiled or installed separately. The same considerations apply for the QwtPlot3D library.

You must use the slightly modified version of the Qwt (5.2) library which is shipped with QtiPlot in the "3rdparty/qwt" folder.

If you need Python scripting support, don't forget to download and install Python, SIP and PyQt4.
In order to build QtiPlot you also need qmake, which is distributed as a part of Qt.

Linux/Mac OS X:

Binaries from maintenance contracts:

Ion Vasilief offers supported QtiPlot binaries as Debian packages (for Debian, Ubuntu, ...) as well as for Mac OS X (>= 10.4). The packages provide all needed libraries, except Python and Qt (on Linux), which must be installed separately on your system.

QtiPlot Linux binaries free of charge:

The QtiPlot team offers GNU/Linux binaries free of charge but without any guaranteed support.
To use this service, you need to subscribe to a maintenance contract. You can find details about this here: QtiPlot download page.
To install the Debian package, download the file qtiplot_X.X.X_i386.deb and login to your machine as "root" (on Ubuntu, login as a normal user and prepend sudo), then open a terminal and execute the following command:
dpkg -i qtiplot_X.X.X_i386.deb
To install the binary package on Mac OS X, download the file qtiplot-X.X.X.pkg.zip, unzip it, double-click on the "qtiplot-X.X.X.pkg" file and follow the installation instructions. Some time after each release, you will find these (including notes how to install them) on the QtiPlot download page or in the files section at the QtiPlot project page at berliOS.

Compiling QtiPlot from source:

  1. Install all the dependencies listed above either from your package manager or from the sources. If you are using precompiled packages, make sure you also install the corresponding development packages (*-dev or *-devel). If you want to display the manual from within QtiPlot (you can also view it with your favorite browser), you also need the Qt Assistant, which sometimes comes in a separate package (qt4-dev-tools for Ubuntu edgy).
  2. Open a terminal window.
  3. Download the .tar.bz2 archive with QtiPlot's sources (or the .zip archive, which has the same contents):
    wget http://soft.proindependent.com/src/qtiplot-X.X.X.tar.bz2
  4. Unpack the source archive: tar -xvjf qtiplot-X.X.X.tar.bz2 (or unzip qtiplot-X.X.X.zip, respectively)
  5. Go to the main directory qtiplot-X.X.X:
    cd qtiplot-X.X.X
  6. Create a build.conf file. You can use the provided example for this:
    cp build.conf.example build.conf
  7. Open build.conf in your favorite editor. Near the bottom of the same file, either comment out the line SCRIPTING_LANGS += Python or make sure you have the following additional dependencies installed: Python, SIP and PyQt4
  8. Build qtiplot:
    qmake && make
  9. Install QtiPlot on your system (you need root privileges):
    sudo make install
    or, alternatively,
    su -c "make install"

Windows:

Binaries from maintenance contracts:

Ion Vasilief offers supported QtiPlot Windows binaries. For platform specific issues of Qt4 based applications see http://doc.qt.io/qt-4.8/windows-support.html.
To install:

  1. Download the qtiplot-X.X.X.exe file.
  2. Open a Windows Explorer, double click on 'qtiplot-X.X.X.exe' and follow the installation instructions.

Compiling QtiPlot from source:

The compilation process requires the same steps as explained above in the Linux/Mac OS X section.
Hmmm... Since this really is not the case, the following section contains a little HOWTO for compiling Qtiplot for Windows. Have fun! :-)

Detailed Compiling Instructions for Usage with Windows

  1. Download and install the latest Qt-SDK release (https://www.qt.io/download/).
  2. Download and install Python 2.6.4 (or a newer version depending on the recommendation of https://www.qtiplot.com/).
  3. Download and unpack Coreutils for Windows (Binary+Dependencies) (http://gnuwin32.sourceforge.net/packages/coreutils.htm). It is recommended to save them to mingw\coreutils in your Qt installation directory.
  4. Download and unpack Sed for Windows (Binary+Dependencies) (http://gnuwin32.sourceforge.net/packages/sed.htm).It is recommended to save them to mingw\coreutils in your Qt installation directory.
  5. Now edit the file bin/qtenv.bat in your Qt installation directory (you may need to adjust pathes):
    @echo off
    rem
    rem This file is generated
    rem
    echo Setting up a MinGW/Qt only environment...
    echo -- QTDIR set to C:\Qt-4.6\qt
    echo -- PATH set to C:\Qt-4.6\qt\bin
    echo -- Adding C:\Qt-4.6\bin to PATH
    echo -- Adding C:\Qt-4.6\mingw\bin to PATH
    echo -- Adding C:\Python26 to PATH
    echo -- Adding C:\Qt-4.6\mingw\coreutils\bin to PATH
    echo -- Adding %SystemRoot%\System32 to PATH
    echo -- QMAKESPEC set to win32-g++
    set QTDIR=C:\Qt-4.6\qt
    set PATH=C:\Qt-4.6\qt\bin
    set PATH=%PATH%;C:\Qt-4.6\bin
    set PATH=%PATH%;C:\Qt-4.6\mingw\bin
    set PATH=%PATH%;C:\Python26
    set PATH=%PATH%;C:\Qt-4.6\mingw\coreutils\bin
    set PATH=%PATH%;%SystemRoot%\System32
    set QMAKESPEC=win32-g++
    
    All compilation work will be done from the Qt Command Prompt (QCP). A link to the Qt Command Prompt is located in your start menu once the Qt installation is done.
  6. Download and unpack SIP (http://www.riverbankcomputing.co.uk/software/sip/download). In QCP type:
    cd <path you unacked SIP to>
    python configure.py
    mingw32-make
    mingw32-make install
    
  7. Download and unpack PyQt4 (http://www.riverbankcomputing.co.uk/software/pyqt/download). In QCP type:
    cd <path you unacked PyQt4 to>
    python configure.py
    mingw32-make
    mingw32-make install
    
  8. Download and unpack the Qtiplot sources(https://www.qtiplot.com/).
  9. Download the following source packages and unpack them into the 3rdparty directory of your Qtiplot source directory:
    boost
    EmfEngine
    GSL for Windows (Binaries+Developer files)
    libpng
    muparser
    zlib (Do not replace the existing zlib directory in the 3rdparty folder. Instead unpack it to e.g. 3rdparty/zlib-1.2.3)

    Now your 3rdparty folder should look like this:
    [3rdparty]
      [..]
      boost
      dirs.txt
      EmfEngine
      gsl
      liborigin
      libpng
      muparser
      QTeXEngine
      qwt
      qwtplot3d
      zlib
      zlib-1.2.3
    
    For each following listing in this manual the Qtiplot source root directory is assumed as the current working directory.
  10. Now prepare compiling the necessary components of the boost library. Therefore you need to compile the bjam tool. In QCP type:
    cd 3rdparty/boost/tools/jam/stage
    build.bat mingw
    
    Now copy 3rdparty/boost/tools/jam/stage/bin.ntx86/bjam.exe to the coreutils\bin folder in your Qt directory. Then compile the date_time library and the threat library located in 3rdparty/boost/libs. In QCP type:
    cd 3rdparty/boost/libs/date_time/build
    bjam --toolset=gcc release
    cd ../thread/build
    bjam --toolset=gcc release
    
    The resulting libraries are located in 3rdparty\boost\bin.v2\libs\<lib name>\build\gcc-mingw-4.4.0\release and need to be specified in build.conf in your Qtiplot folder when compiling Qtiplot itself.
  11. Now compile the EmfEngine. Since mingw is used (and not MSVC), you need to comment the line.
    win32:CONFIG += HAVE_GDI_PLUS
    
    in 3rdparty/EmfEngine/config.pri. Compile the EmfEngine in QCP as follows:
    cd 3rdparty/EmfEngine
    qmake
    mingw32-make
    
  12. Compile liborigin by typing the following lines in QCP:
    cd 3rdparty/liborigin
    qmake
    mingw32-make
    
  13. Type the following lines in QCP to compile the zlib (the one in 3rdparty/zlib-1.2.3):
    cd 3rdparty/zlib-1.2.3
    mingw32-make -f win32/Makefile.gcc
    
  14. Create the following Makefile in 3rdparty/zlib to prepare the compilation of the zlib library (3rdparty/zlib):
    zlib123.a:
    	gcc -c minigzip.c -o zlib.o
    	ar rcs zlib.a zlib.o
    clean:
    	erase zlib.o
    	erase zlib.a
    
    Type the following lines in QCP to compile the library:
    cd 3rdparty/zlib
    mingw32-make
    
  15. Open 3rdparty/libpng/scripts/makefile.mingw in your favorite text editor and search for the following lines to prepare the compilation of the libpng:
    ZLIBLIB=...
    ZLIBINC=...
    
    Change these lines into:
    ZLIBLIB=../zlib-1.2.3
    ZLIBINC=../zlib-1.2.3
    
    Now search for:
    LDFLAGS=...
    LDSFLAGS=...
    LDEXTRA=...
    
    Change these lines into:
    LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB))) $(ZLIBLIB)/libz.a
    LDSFLAGS=$(strip -shared -L.  $(MINGW_LDFLAGS))
    LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) $(ZLIBLIB)/libz.a
    
    Compile the libpng in QCP type:
    cd 3rdparty/libpng
    mingw32-make -f scripts/makefile.mingw static
    
  16. Now compile the muparser library typing the following lines in QCP:
    cd 3rdparty/muparser/build
    mingw32-make -f makefile.mingw
    
  17. Make sure that the following lines in 3rdparty/qwtplot3d/qwtplot3d.pri are (un-)commented in the following way to prepare the compilation of the qwtplot3d library:
    DEFINES += GL2PS_HAVE_LIBPNG
    #win32:CONFIG -= zlib
    
    Now type
    cd 3rdparty/qwtplot3d
    qmake 
    
    in QCP. Open Makefile.Release and search for the lines
    INCPATH = ...
    LIBS = ...
    
    Change them into:
    INCPATH = -I"c:\Qt-4.6\qt\include\QtCore" -I"c:\Qt-4.6\qt\include\QtGui" -I"c:\Qt-4.6\qt\include\QtOpenGL" \
    -I"c:\Qt-4.6\qt\include" -I"include" -I"c:\Qt-4.6\qt\include\ActiveQt" -I"tmp" -I"c:\Qt-4.6\qt\mkspecs\win32-g++" \
    -I"../zlib-1.2.3" -I"../libpng"
    LIBS = -L"c:\Qt-4.6\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 ../zlib-1.2.3/libz.a ../libpng/libpng.a \
    -lQtOpenGL4 -lQtGui4 -lQtCore4 
    
    Type mingw32-make release in QCP to finish the compilation of the library.
  18. Type the following lines in QCP to compile the qwt and QTeXEngine libraries:
    cd 3rdparty/qwt
    qmake
    mingw32-make
    cd ../QTeXEngine
    qmake
    mingw32-make
    
  19. Now compile Qtiplot itself. First copy build.conf.example to build.conf in your Qtiplot source directory. Adjust the pathes in build.conf. The following build.conf file might help you:
    isEmpty( QTI_ROOT ) {
      message( "each file including this config needs to set QTI_ROOT to the dir containing this file!" )
    }
    
    ##########################################################
    ##     System specific configuration     
    ##########################################################
    
    # Global include path which is always added at the end of the INCLUDEPATH
    SYS_INCLUDEPATH = C:\Qt-4.6\mingw\include
    # Global lib path and libs which is ls always added at the end of LIBS
    SYS_LIBS = -L"C:\Qt-4.6\mingw\lib"
    
    ##########################################################
    ## muParser (http://muparser.sourceforge.net/)
    ##########################################################
    
    # include path. leave it blank to use SYS_INCLUDE
    MUPARSER_INCLUDEPATH = $$QTI_ROOT/3rdparty/muparser/include
    # link statically against a copy in 3rdparty/
    MUPARSER_LIBS = $$QTI_ROOT/3rdparty/muparser/lib/libmuparser.a
    # or dynamically against a system-wide installation
    #MUPARSER_LIBS = -lmuparser
    
    ##########################################################
    ## GNU Sientific Library (http://www.gnu.org/software/gsl/) 
    ##########################################################
    
    # include path. leave it blank to use SYS_INCLUDE
    GSL_INCLUDEPATH = $$QTI_ROOT/3rdparty/gsl/include
    # link statically against a copy in 3rdparty/
    GSL_LIBS = $$QTI_ROOT/3rdparty/gsl/lib/libgsl.a \
               $$QTI_ROOT/3rdparty/gsl/lib/libgslcblas.a
    # or dynamically against a system-wide installation
    #GSL_LIBS = -lgsl -lgslcblas
    
    ##########################################################
    ## Boost libraries (http://www.boost.org/)
    ##########################################################
    
    # include path. leave it blank to use SYS_INCLUDE
    BOOST_INCLUDEPATH = $$QTI_ROOT/3rdparty/boost
    # link statically against a copy in 3rdparty/
    unix: BOOST_LIBS = $$QTI_ROOT/3rdparty/boost/lib/libboost_date_time-gcc43-mt-1_38.a \
      $$QTI_ROOT/3rdparty/boost/lib/libboost_thread-gcc43-mt-1_38.a
    win32:BOOST_LIBS = $$QTI_ROOT/3rdparty/boost/bin.v2/libs/date_time/build/gcc-mingw-4.4.0/release/boost_date_time-mgw44-1_41.lib \
      $$QTI_ROOT/3rdparty/boost/bin.v2/libs/thread/build/gcc-mingw-4.4.0/release/threading-multi/boost_thread-mgw44-mt-1_41.lib
    # or dynamically against a system-wide installation
    #BOOST_LIBS = -lboost_date_time-mt -lboost_thread-mt
    
    ##########################################################
    ## QWT - use local copy till upstream catches up
    # http://qwt.sourceforge.net/index.html
    ##########################################################
    
    # include path. 
    QWT_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwt/src
    # link locally against a copy in 3rdparty/
    QWT_LIBS = $$QTI_ROOT/3rdparty/qwt/lib/libqwt.a
    
    ##########################################################
    ## libpng - optional. you don't have to set these variables
    ##########################################################
    
    # include path. leave it blank to use SYS_INCLUDE
    LIBPNG_INCLUDEPATH = $$QTI_ROOT/3rdparty/libpng/
    # link statically against a copy in 3rdparty/
    LIBPNG_LIBS = $$QTI_ROOT/3rdparty/libpng/libpng.a
    # or dynamically against a system-wide installation
    #LIBPNG_LIBS = -lpng
    
    ##########################################################
    ## EmfEngine - optional. you don't have to set these variables
    # http://soft.proindependent.com/emf/index.html
    ##########################################################
    
    # include path. 
    EMF_ENGINE_INCLUDEPATH = $$QTI_ROOT/3rdparty/EmfEngine/src
    # link locally against a copy in 3rdparty/
    EMF_ENGINE_LIBS = $$QTI_ROOT/3rdparty/EmfEngine/libEmfEngine.a
    
    ############################################################
    ##  Target specific configuration: configure Qtiplot itself
    ############################################################
    
    contains( TARGET, qtiplot ) {
      # building without muParser doesn't work yet
      SCRIPTING_LANGS += muParser
      SCRIPTING_LANGS += Python
    
      # a console displaying output of scripts; particularly useful on Windows
      # where running QtiPlot from a terminal is inconvenient
      DEFINES         += SCRIPTING_CONSOLE
    
      # a dialog for selecting the scripting language on a per-project basis
      DEFINES         += SCRIPTING_DIALOG
    
      #DEFINES         += QTIPLOT_DEMO
    
      # Comment the following lines to disable donations start-up message.
      #DEFINES         += QTIPLOT_SUPPORT
    
      # Uncomment the following line if you want to perform a custom installation using the *.path variables defined in ./qtiplot.pro.
      #CONFIG          += CustomInstall
    
      CONFIG          += release
      #CONFIG          += debug
      #win32: CONFIG   += console
    
    Type the following lines in QCP to compile Qtiplot:
        cd qtiplot
        qmake
        mingw32-make
    
    Compiling Qtiplot 0.9.7.10 gcc throws a weird error caused by a missing source file (sipqtiQList.cpp) in the tmp/qtiplot directory in the Qtiplot source folder. This error might be caused by SIP (no sure ...). To correct this error, create the file 'sipqtiQList.cpp' and copy the content of the files
    sipqtiQList0101Folder.cpp
    sipqtiQList0101Graph.cpp
    sipqtiQList0101MdiSubWindow.cpp
    
    into the empty file. Open qtiplot/Makefile.Release in your favorite text editor and search for the following line to avoid a gdiplus linker error:
    LIBS = ...
    
    In this line search for the flag '-lgdiplus' and replace it with '-mwindows'. Now restart the compilation typing mingw32-make in QCP. The file qtiplot.exe now should be correctly created. Compile the fitPlugins typing the following lines in QCP:
    cd fitPlugins
    qmake
    mingw32-make
    
  20. Copy qtiplot.exe and all dependencies to a new directory to create a distributable version of Qtiplot. This directory should at least contain the following:
    Qtiplot:
      [..]
      fitPlugins:
        [..]
        exp_saturation.dll
        explin.dll
        fitRational0.dll
        fitRational1.dll
        planck_wavelength.dll
    
      PyQt4:
        [..]
        __init__.py
        QtCore.pyd
        QtGui.pyd
    
      _abcoll.pyc
      abc.pyc
      assistant_adp.exe
      boost_date_time-mgw44-1_41.dll
      boost_thread-mgw44-mt-1_41.dll
      codecs.pyc
      copy_reg.pyc
      functools.pyc
      genericpath.pyc
      libgcc_s_dw2-1.dll
      linecache.pyc
      locale.pyc
      mingwm10.dll
      ntpath.pyc
      os.pyc
      py_compile.pyc
      python26.dll
      Qt3Support4.dll
      QtAssistantClient4.dll
      QtCore4.dll
      QtGui4.dll
      qti_wordlist.txt
      qtiplot.exe
      qtiplotrc.py
      qtiUtil.py
      qtiUtil.pyc
      QtNetwork4.dll
      QtOpenGL4.dll
      QtSql4.dll
      QtSvg4.dll
      QtXml4.dll
      re.pyc
      sip.pyd
      site.pyc
      sre_compile.pyc
      sre_constants.pyc
      sre_parse.pyc
      stat.pyc
      traceback.pyc
      types.pyc
      UserDict.pyc
      warnings.pyc
    
    All of these files can either be found in the Qtiplot source directory, the Qt installation directory or the Python installation directory (just search ;-)).
  21. An installer for Qtiplot can be created using the following NSIS script as a basis (http://nsis.sourceforge.net/Download):
    Have fun using Qtiplot!!

Frequently Asked Questions (FAQ)

1. How can I visualise data from a text file?

Go to the 'File' menu->'Import ASCII'->'Single file'

If the file is not imported correctly, change the columns separator using: 'File' menu->'Import ASCII'->'Set import options'

The default columns separator is the TAB.

2. How can I plot data from a table (worksheet)?

Click on the table header to choose the columns to plot and then right click. Chose the 'Plot' option from the pop-up menu and then the type of plot you want.

3. How can I export a plot to an image format?

Right click in the plot window and chose the 'Export' option.

4. Can I export transparent images?

Yes, ".png" images have transparent background.

5. How can I export a text file?

Go to the 'File' menu->'Export ASCII'

6. How can I choose a window using the project explorer?

Double click on the window name will show the window maximized, even if it was hidden before.

7. How can I choose the data range from a plot curve, when doing a curve fit?

Go to the 'Data' menu->'Select data range'. Click in the plot window and use the arrows 'Up' and 'Down' keys to select the curve to analyse. Keeping 'CTRL' button and 'Left' or 'Right' arrow keys pressed simultaneousely permit to move the selected cursor and consequently to modify the data range.

8. Can I fit a plot curve using my own function?

Go to the 'Analysis' menu->'Non-linear Curve Fit...'. Define the function (myFunction=...), enter the initial guesses for the parameters, separated by comas, choose the fitting range and the number of iterations and click 'OK'.

9. How can I visualize a pixel line profile from an image?

Right click on the image you want to analyse and select the option 'View pixel line profile' from the popup menu. A dialog window opens and allows you to select the number of pixels used for the analysis. Choose a value and click "OK". Then click on the image to select the start point and move your mouse to select an end point while keeping the left button pressed. When you release the left button a plot window appears, representing the pixel intensity versus pixel index.