tecCmd is a utility for generating publication quality plots effortlessly. I wrote the script around 2018. I used it extensively during my PhD.
I was using gnuplot initially for plotting data. Gnuplot is excellent. But the output files are not suitable for directly putting into publications. An another plotting software is Tecplot. It is extensively used in the field of computational fluid dynamics for visualization. Around 2018, Tecplot released a python API for their Tecplot-360. This means that we need not launch a GUI to plot data. The command line utilities are much more memory efficient. They also open up opportunities for automation using simple bash scripting. A Python API together with evil eval can be exploited for data manipulation.
Features:
- Generate tecplot layout files using simple and intuitive scripting similar to gnuplot (see examples below)
- Column data can be manipulated in an arbitrary fashion, limited only by the capabilities of Python expression evaluation engine.
- Low memory footprint. Launching Tecplot over SSH is remarkably slow. You can instead write a simple script and directly generate the postscript files.
It gets the job done. I wrote it on a Friday evening.
See the examples directory for the input data files.
Reading matrix from data.txt and plotting column 1 on x-axis and column 2 on y-axis.
gnuplot | tecCmd |
---|---|
|
|
Using functions to transform the input matrix columns. In this example, I am reading matrix from data.txt, plotting column 1 on x-axis, and sin(pi$1)* on the y-axis. The syntax convention is close to gnuplot. Functions defined in numpy are available in global namespace and can be evaluated.
Using user defined functions to transform the input matrix columns. Everything that appears after keyword is passed to exec
Plot multiple lines: Legendre Polynomials.
Sometimes we have log files. Bash utilities are useful for analyzing log files. This example shows how to execute bash command, and utilize the output to plot data.