Best plot and charting C++ packages for data visualization

plot image

While in Python Matplotlib seems the de facto standard for plotting and charting, no real incumbent is established when it comes to data visualization in C++.

I had to review several packages for data visualization in C++, and here are my (partial and incomplete) evaluations:

  • gnuplot with the necessary wrapper gnuplot-iostream . Gnuplot is a old (1986, 30-some years ago, but still updated) standalone software with a vibrant community actively developing it.
    Pros: rather easy and powerful; 3d charts available; lots of examples and tutorial; nice appearance.
    Cons: cannot be embedded in the executable produced: the gnuplot software must be installed on the target machine while running the executable; a certain lack of flexibility and integration; non freeware license that prevents it from being modified and distributed with your code.
    Some examples from Youtube: https://www.youtube.com/results?search_query=gnuplot+3d

    Link: http://www.gnuplot.info
    C++ wrapper: https://github.com/dstahlke/gnuplot-iostream

  • DISLIN: commercial package from the german Max Planck Institute. The demos are impressive, it appears to be both flexible and functional. It supports a wide variety of languages and compilers.
    Pros: nice appearance; 3d charts available; supports also an output in OpenGl; (should be) possible to statically link it in the executable code.
    Cons: commercial package, free for non-commercial usage; closed source software, the code is available only to license purchasers (and sent via DVD).

    NOTE: the license they provide allows you to compile and distribute executable copies of your software, BUT does not allow you to distribute a copy of your source code and let the user freely compile your software (as is any open source project). The user might have to purchase a license to compile the code on their own.

    Link: https://www.mps.mpg.de/dislin

  • Matplotlib with the required matplotlib-cpp wrapper. Matplotlib is an impressive Python data visualization library that has become widely popular in the latest years. It supports both 2D and 3D graphs, and an absurd number of graph types.
    Pros: very powerful, 2D and 3D graphs and charts available; huge community with extensive tutorials and examples available; open source and free software under the Python Software Foundation (PSF) license.
    Cons: cannot be statically linked in the executable; being a Python library, it requires Python and the matplotlib library must be installed on the target machine.

    Examples of what can be done with it can be found here https://matplotlib.org/gallery/index.html

    Link: https://matplotlib.org/
    C++ wrapper: https://github.com/lava/matplotlib-cpp

  • QCustomPlot: nice looking library, but unable to draw 3D graphs/charts/plots.

    Link: https://www.qcustomplot.com/

  • QTchart : very nice, but (as far as I know) unable to do 3D graphs. Now available also under GPL license.
    Some examples can be found here https://doc.qt.io/qt-5/qtcharts-examples.html

    Link: https://doc.qt.io/qt-5/qtcharts-index.html

  • Qwt: I have not tried it yet, but it seems unable to create 3D graphs.

    Link: https://qwt.sourceforge.io/

  • VTK: more than a data visualization, it appears to be a powerful 2D and 3D modeling library that can be used also for creating charts and graphs. Licensed under the BSD license. Might be a little overkill for most applications.
    Here are some examples of what can be done with it: https://vtk.org/vtk-in-action/#image-gallery

    Link: https://vtk.org/

  • Koolplot: I have not tried it yet, but it seems unable to create 3D graphs.

    Link: http://koolplot.codecutter.org/

  • MathGL: not yet tried, still developed. It does not have a image gallery.

    Link: http://mathgl.sourceforge.net/

  • ROOT: oh dear! It is a 2D and 3D standalone software for data analysis and visualization. It does its job of crunching HUGE amounts of numbers at lightning speed, but it is rather buggy and user-unfrendly. Unless you are into particle physics, there is no real reason to work with CERN’s ROOT.

    Link: https://root.cern.ch/

C++ 

See also