Credits | Overview | Plotting Styles | Commands | Terminals
--- | --- | --- | --- | ---

## piped-data

On systems with a popen function, the datafile can be piped through a shell command by starting the file name with a '<'. For example,

          pop(x) = 103*exp(-x/10)
          plot "< awk '{print $1-1965, $2}' population.dat", pop(x)

would plot the same information as the first population example but with years since 1965 as the x axis. If you want to execute this example, you have to delete all comments from the data file above or substitute the following command for the first part of the command above (the part up to the comma):

          plot "< awk '$0 !~ /^#/ {print $1-1965, $2}' population.dat"

While this approach is most flexible, it is possible to achieve simple filtering with the using keyword.

On systems with an fdopen() function, data can be read from an arbitrary file descriptor attached to either a file or pipe. To read from file descriptor n use '<&n'. This allows you to easily pipe in several data files in a single call from a POSIX shell:

          $ gnuplot -p -e "plot '<&3', '<&4'" 3<data-3 4<data-4
          $ ./gnuplot 5< <(myprogram -with -options)
          gnuplot> plot '<&5'