Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send .png plot to stdout in gnuplot?

Tags:

bash

gnuplot

Currently, I do something like the following:

set term png
set output 'file.png'

But hardcoding filename in the script is quite inflexible. Is there some way to tell gnuplot to output image file to stdout, so I will be able to redirect it's output where needed?

like image 353
Rogach Avatar asked Jun 17 '13 12:06

Rogach


1 Answers

If you do want to send your .png to stdout, just don't set the output:

#!/usr/bin/env gnuplot
set term png
plot x

Then run the script

./plot.plt > mypng.png

I think the bash wrapper makes more sense for most purposes, but this is potentially useful as well.

like image 189
andyras Avatar answered Oct 25 '22 20:10

andyras