Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use Caca terminal of Gnuplot

📅 2015-May-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ caca, dumb, gnuplot, ncurses, slang, terminal, x11 ⬩ 📚 Archive

[caption id="attachment_6871" align="alignnone" width="660"][Plot drawn using caca terminal of GNUPlot](https://codeyarns.files.wordpress.com/2015/05/20150511_caca_gnuplot.png) Plot drawn using caca terminal of GNUPlot[/caption]

Gnuplot can plot in ASCII at the terminal if the dumb terminal is chosen. However, this does not fully utilize the Unicode characters and color support of modern terminals. The Caca terminal of Gnuplot uses all the character and color capabilities of your terminal to generate beautiful and colorful plots. It does this by using the Caca library which provides these capabilities.

Build or Install

Gnuplot can be installed easily:

$ sudo apt install gnuplot

Note that support for caca terminal was added in Gnuplot 4.7. If you have that version and it was built with support for caca, then the commands in the next section should work directly.

If you do not have 4.7 and later and if it was not built with caca support, you need to build Gnuplot from source. Here are the steps I followed to build it from source:

$ sudo apt install libcaca-dev
$ ./configure --with-caca
$ make
$ sudo make install

Usage

gnuplot> set terminal caca

You can now plot anything and Caca draws it using ASCII/Unicode characters and colors.

gnuplot> set terminal caca driver list
gnuplot> set terminal caca driver ncurses

Now plot anything and view it in beautiful ASCII/Unicode and colors at the terminal!

Tried with: Gnuplot 5.0.0, Caca 0.99.beta18 and Ubuntu 14.04