Linux Data Visualization Tool

Source: Internet
Author: User
Tags mathematical functions sin

Linux Data Visualization Tool

There are a number of applications for graphical visualization of data on Linux, from simple 2-d drawings to the-to-date cartography, 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.

    • Content
    • Gnuplot
    • GNU Octave
    • Scilab
    • MayaVi
    • Maxima
    • Prospect
Content

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.

Gnuplot is very portable and can be used in UNIX, Microsoft? Windows?, Mac OS? X and many other platforms to run on. 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 the plot command to generate 2-d graphics, or use the Splot command to generate a-shape (as a 2-d projection). Using the plot command, the gnuplot can be manipulated in a right-angled two-dimensional coordinate system. The Splot 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. Simple gnuplot function Diagram  
set  Samples 25  set  isosamples 26  set  title  "Test 3D gnuplot"  set  contour baseset  hidden3d  Offset  1  splot [-12 : 12.01 ] [-12 : 12.01 ] 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 created using the functions inside the math library with the Splot command. As shown in result 1.

图 1. 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.

清单 2. gnuplot 的示例数据文件(data.dat)
8899799876896085...6022

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.

清单 3. 对清单 2 中的数据进行绘图所使用的 Gnuplot 脚本
set"Sample data plot"‘data.dat‘using1:2‘data points‘,   "data.dat"using1:2"lines"withlines

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.

图 2. 在 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.

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.

清单 4. 使用 Octave 呈现 Lorentz Strange Attractor
GNU Octave, version2.1. theCopyright (C)1996,1997,1998,1999, -,2001,2002,2003JohnW. Eaton.This was free software; See the source code forCopyingconditions.There is absolutely NO WARRANTY; Not even forMerchantibilityorFITNESS for A particularPURPOSE.For details, type 'warranty '.Please contributeifYou find this softwareuseful.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 =[ x (2)-X (1)); X (1) * (+-X (3)); X (1 ) * x (2)- 8/3 * x (3)];endfunction>> x = Lsode ("Lorenz",[3;  (a) 1], (0:0.01: -)');>> gset parametric>> gsplot x>>

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

图 3. 使用 Octave 绘制的 Lorentz 图

The GNU Octave (consistent with gnuplot) can use the Multiplot feature to render multiple graphs on a single page. With this feature, you can define how many shapes you want to create, and then use the Subwindow command 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).

清单 5. 在 Octave 中生成多个图形
>> multiplot(2,2)>> subwindow(1,1)>> t=0:0.1:6.0cos(t))>> subwindow(1,2sin(t))>> subwindow(2,1tan(t))>> subwindow(2,2tanh(t))

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

图 4. 使用 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.

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).

图 5. 与 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.

图 6. 图 5 中的命令所生成的 Scilab 图


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) constructs a 5, 5-size matrix that 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.

图 7. 生成随机的三维柱状图

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.

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.

图 8. 使用 MayaVi/VTK 显示的 3-D 可视化(心脏 CT 扫描图)

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

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, maps, and apply) can also be found in Maxima. 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 example (Desolve), and it will 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.

图 9. 与 Maxima 进行交互

The resulting figure 10 shows.

图 10. 图 9 的命令所生成的 Maxima 图形

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.

PS. 本文章由CSDN-Markdown编辑器写成,感觉十分好用!

Linux Data Visualization Tool

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.