Data visualization Tools on Linux

*Introduction to 5 types of open source graphical tools*

There are a number of applications for graphical visualization of data on Linux®, from simple 2-d drawings to a-to-date mapping, to scientific graphics programming and graphical simulations. Fortunately, there are many open source implementations of these tools, including Gnuplot, GNU Octave, Scilab, MayaVi, and Maxima. Each tool has its own pros and cons and is designed for different applications. Exploring these open source graphical visualization tools helps us better decide which tool is best for our application.

0 Reviews:

M. Tim Jones ([email protected]), senior software engineer, Emulex

November 27, 2006

Develop and deploy your next application on the IBM Bluemix cloud platform.

Get started with your trial

A short list of visual tools

In this article, a number of popular Linux data visualization tools are investigated and some of these tools are explored in more depth. For example, does a tool provide a language for numeric calculations? is the tool interactive or does it provide a batch mode to operate on its own? Can I use this tool for image or digital signal processing? Does this tool provide language binding to support integration with user applications (e.g. Python, TCL, Java programming language, etc.)? In addition, the graphical processing capabilities of some tools will be shown. Finally, the strengths of each tool are analyzed to help us determine which tool is best suited for computing tasks or visualizing data.

The open source tools explored in this article include (and also give the license used by each tool):

- Gnuplot (GPL)
- GNU Octave (GPL)
- Scilab (Scilab)
- MayaVi (BSD)
- Maxima (GPL)

Gnuplot

Gnuplot is a very good visualization tool that has existed since 1986. It is difficult to read a paper without a gnuplot diagram. Although Gnuplot is command-line driven, it is also evolving and can now support many non-interactive applications, such as it can be used as a drawing engine for the GNU Octave.

The gnuplot is very portable and can be run on UNIX®, microsoft®windows®, Mac os®x, and many other platforms. It can support a very wide range of output formats, from PostScript to recent PNG.

Gnuplot can operate in batch mode, provide a command script to generate a graph, and also run in noninteractive mode, which allows us to try its features to understand the effects of their drawing.

In Gnuplot, there is a standard math library that corresponds to the UNIX math library that can be used. The parameters of the function support integer, real and complex types. You can configure the math library to be radians or angles (the default is radians).

For drawing purposes, gnuplot can use `plot`

commands to generate 2-d graphics, or use `splot`

commands to generate a-page graphic (as a 2-d projection). With `plot`

commands, the gnuplot can be manipulated in a right-angled two-dimensional coordinate system. `splot`

the command uses a Cartesian coordinate system by default, but it can also support a spherical or cylindrical coordinate system. You can also draw contours in the drawing (as shown in Figure 1 below). A new style of drawing `pm3d`

can be used to draw 4D data that is mapped using a color palette as a map or as a surface chart.

The following is a simple example of gnuplot, which gives a shape with the contour line and the hidden line elimination. Listing 1 shows the gnuplot command used, and Figure 1 shows the resulting graphical result.

Listing 1. A simple gnuplot function diagram

Set Samples 25set isosamples 26set title "Test 3D gnuplot" set contour baseset hidden3d offset 1splot [ -12:12.01] [ -12:12.0 1] sin (sqrt (x**2+y**2))/sqrt (x**2+y**2)

Listing 1 shows how simple the gnuplot command set is. The sampling speed and the plot density are determined by samples and Isosamples, and the title is provided as a graphic by the title parameter. The basic contour and hidden line cancellation features are also enabled, and the final drawing is `splot`

created with commands using functions inside the math library. As shown in result 1.

Figure 1. A simple drawing of gnuplot

In addition to creating a function diagram, gnuplot can also draw well on the graphics contained in the file. Consider the X/Y data pair (a short version of this file) as shown in Listing 2. The data given in this file is the data representing the X and Y axes in a two-D space.

Listing 2. Gnuplot Sample Data file (Data.dat)

88 9979 9876 8960 85...60 22

If you want to draw this data in a two-D space and connect each data point with one line, you can use the Gnuplot script given in Listing 3.

Listing 3. The Gnuplot script used to draw the data in Listing 2

Set title "Sample Data Plot" plot ' Data.dat ' using 1:2 t ' data points ', "Data.dat" using 1:2 T "lines" with lines

As shown in result 2. Note that the gnuplot automatically gives the axis scale, but you can control it if you need to label the position of the graphic.

Figure 2. Use data files for simple drawing in gnuplot

Gnuplot is a great visualization tool and is very well known and is part of many gnu/linux distributions. However, if you want to perform basic data visualization and numerical calculations, then GNU Octave may be the tool we want to look for.

Back to top of page

GNU Octave

The GNU Octave is a high-level language designed primarily for numerical calculations and is a powerful competitive product of MathWorks's Matlab business software. In addition to the simple set of commands provided by Gnuplot, Octave provides a rich language for mathematical programming. We can even write our own applications using the C or C + + language and then interact with Octave.

Octave was originally written as a supporting software for the chemical reactor design textbook in 1992. Its authors hope to help students solve reactor design problems without having to debug a Fortran program. The result is a very useful language and provides an interactive environment for solving numerical problems.

Octave can operate non-interactively in a scripted pattern, or through C and C + + language bindings. Octave itself has a very rich language that looks very similar to the C language and has a large library of math, including some of the special functions used in signal and image processing, audio processing, and control theory.

Since Octave uses gnuplot as the backend implementation, everything you can draw with gnuplot can be drawn using Octave. Octave does have a richer language to calculate, it has many obvious advantages, but there are still some limitations of gnuplot.

In the example provided below on this Octave-forge Web site (simpleexamples), a Lorentz Strange attractor is drawn. Listing 4 shows the interactive dialog box used by Octave on the Windows platform using Cygwin. This example shows the use of lsode, a common differential equation solver.

Listing 4. Use Octave to render Lorentz Strange attractor

GNU Octave, Version 2.1.50 Copyright (C) 1996, 1997, 1998, 1999, D, 2001, 2002, 2003 John W. Eaton.this E See the source code for copying conditions. There is absolutely NO WARRANTY; Not even for merchantibility orfitness for A particular PURPOSE. For details, type ' warranty '. Contribute if you find this software useful. For more information, visit Http://www.octave.org/help-wanted.htmlReport Bugs to <bug-octave&bevo.che.wisc.edu >.>> function y = Lorenz (x, t) y = [Ten * (X (2)-X (1)); X (1) * (28-x (3)); X (1) * x (2)-8/3 * x (3)];endfunction& gt;> x = Lsode ("Lorenz", [3;15;1], (0:0.01:25) ');>> gset parametric>> gsplot x>>

The diagram shown in Figure 3 shows the output of the Octave code in Listing 4.

Figure 3. Lorentz diagram drawn with Octave

The GNU Octave (consistent with gnuplot) can use `multiplot`

attributes to render multiple graphs on a single page. With this feature, you can define how many shapes you want to create, and then use `subwindow`

commands to customize specific graphics. After you have defined the child window, you can normally generate your own graphics, and then jump to the next Subwindow (as shown in Listing 5).

Listing 5. Generate multiple shapes in Octave

>> Multiplot (2,2) >> subwindow (All) >> t=0:0.1:6.0>> plot (t, cos (t)) >> Subwindow >> plot (t, sin (t)) >> Subwindow (2,1) >> plot (T, tan (t)) >> Subwindow (2,2) >> plot (T, Tanh (t) )

The resulting multi-figure page 4 shows. This is a good feature for comparing and contrasting related graphs.

Figure 4. Drawing multiple graphs using the GNU Octave

We can think of Octave as a high-level language for visualizing using gnuplot as a background implementation. It offers a rich library of math and is a good free replacement for Matlab. It can be easily extended using a package developed by the user for speech processing, optimization, symbolic computation, and so on. Octave is available in some gnu/linux distributions, such as Debian, and can be used on Windows and Mac OS X using Cygwin. For more information about Octave, see the Resources section.

Back to top of page

Scilab

Scilab is very similar to the GNU Octave in enabling numeric calculations and visualizations. Scilab is an interpreter and high-level language used by engineering and science applications that are widely available in the world.

Scilab was born in 1994, it was made by the French Inria (Institut national de recherche en informatique et en automatique) and ENPC (École nationale des Ponts et Chaussées) was designed. Starting from 2003, Scilab began to be maintained by Scilab Consortium.

Scilab includes a large library of mathematical functions that can be augmented with programs written in high-level languages such as C and Fortran. It also has the ability to overload data types and operations. It includes an integrated high-level language, but this language is slightly different from the C language.

There are many toolkits in Scilab that provide graphics animation, optimization, statistics, icon and network, signal processing, hybrid dynamic system simulation and simulation, and many other functions contributed by the community in 2-d and.

Scilab can be used on most UNIX systems and can be used on newer Windows operating systems. Like the GNU Octave, Scilab also has very good documentation. Because it is a European project, you can also find many documents and articles written in languages other than English.

After starting Scilab, a window is displayed so that we can interact with it (5).

Figure 5. Interacting with Scilab

In this example, we first create a vector (t) with values ranging from 0 to 2PI (step size 0.2). A z=f is then generated (using X, y, or a surface at the xi,yi point). Figure 6 shows the resulting graph.

Figure 6. The Scilab diagram generated by the command in Figure 5

Scilab includes many libraries and functions that can draw graphics with minimal complexity. Here is an example of creating a simple three-dimensional histogram:

` -->hist3d(5*(rand(5,5)); `

First, `rand(5,5)`

a matrix of size 5 and 5 is constructed, which contains some random values (with a maximum value of 5). This matrix is passed to the function `hist3d`

. The resulting histogram is shown in Figure 7.

Figure 7. Generate a random three-dimensional column chart

Scilab and Octave are very similar. They all have a large community participation base. Scilab is written using Fortran 77, while Octave is written in C + +. Octave uses gnuplot for visualization, and Scilab provides its own library. If you are familiar with Matlab, then Octave is a good choice, because it strives to achieve compatibility with MATLAB. The Scilab includes a number of mathematical functions and is therefore ideal for signal processing. If you're still unsure which tool to use, you can try it all. They are good tools that can be used to accomplish different tasks.

Back to top of page

MayaVi

MayaVi in Sanskrit means a magician, a data visualization tool that binds Python with a powerful Visual toolkit (VTK) for graphical display. MayaVi also provides a graphical user interface (GUI) developed using the Tkinter module. Tkinter is a Tk interface that is usually used with TCL.

MayaVi was originally developed for Computational Fluid Dynamics (CFD) as a visual tool. When people recognize its usefulness in other areas, it is redesigned as a universal scientific data visualization tool.

The magic behind MayaVi comes from VTK. VTK is an open source system for data visualization and image processing, which is widely used in the scientific community. VTK encapsulates a number of features by providing scripted interfaces for TCL/TK, the Java programming language, and Python plus the C + + library. VTK is portable on many operating systems, including UNIX, Windows, and MAC OS X.

The MayaVi shell around the VTK can be imported as a Python module from other Python programs and scripted using the Python interpreter. The Tkinter GUI provided by MayaVi allows for the configuration and application of filters, as well as rendering some lighting effects on a visual basis.

Figure 8 is an example of using MayaVi on a Windows platform for visualization.

Figure 8. Use the MAYAVI/VTK display (Heart CT scan)

MayaVi is an interesting example of extending VTK in the Python scripting language.

Back to top of page

Maxima

Maxima is a symbolic and numerical program that is the blood of Octave and Scilab. Maxima's initial development team started in the 1870s at the MIT (MA Sound Polytechnic) and is now continuing its maintenance. The original version (a computer algebra system), called DOE Macsyma, opened the way for more well-known applications (such as Mathematica) that were later developed.

Maxima provides a set of expected feature sets (such as calculus, analytic linear systems, and nonlinear equation sets) as well as symbolic computing capabilities. Some clues to Lisp (from functions such as references, `map`

and in) can also be found in Maxima `apply`

. Maxima is written in Lisp and can execute Lisp code in a Maxima session.

Maxima has a good online help system, which is based on hypertext. For example, if you want to know how a particular Maxima function works, you can simply enter it and `example( desolve )`

then provide a lot of sample usage.

Maxima also has some interesting features, such as rules and patterns. These rules and patterns are used by the program used to simplify the expression. Rules can be used for interchange and non-commutative algebra.

Maxima is very similar to Octave and Scilab: where the interpreter can be used to interact with the user, the results are provided directly in the same window, or they can be displayed in a different window. In Figure 9, the request draws a simple-to-medium shape.

Figure 9. Interacting with Maxima

The resulting figure 10 shows.

Figure 10. Figure 9 The Maxima graph generated by the command

Back to top of page

Prospect

Several open source Gnu/linux visualization tools are described in this article. Other useful tools include Gri, Pgplot, Scigraphica, Plotutils, NCAR Graphics, and Imlib3d. These are open source, which means you can see how they work, and you can modify them if you want. Also, if you're looking for a good graphical simulation environment, check out the Open Dynamics Engine (ODE) used with OpenGL.

Specific needs determine which tool is best for use. If you want to use a powerful visualization system with a lot of visualization algorithms, then MayaVi is the tool you are looking for. The GNU Octave and Scilab are well suited for numerical computations with visual capabilities. If you need symbolic computing power, then Maxima is a great choice. Last (but not least), if all you need is some basic drawing functionality, then gnuplot can do well to meet this requirement.

Data visualization Tools on Linux