How do I check if a terminal is available through my gnuplot script?

Viewed 1751

I want to set terminal to pngcairo instead of png whenever the pngcairo terminal is available, and I don't want to manually check for its availability and update my script everytime.

When pngcairo terminal is not available, I get the following error in my script:

set terminal pngcairo
             ^
"./script.gnuplot", line 7: unknown or ambiguous terminal type; type just 'set terminal' for a list

How do I test for pngcairo's availability in my gnuplot script so that I can set terminal to png in its absence?

1 Answers
Related