Skip to content

Instantly share code, notes, and snippets.

@dafuer
Created December 28, 2015 14:41
Show Gist options
  • Save dafuer/18cded971a254dd9e379 to your computer and use it in GitHub Desktop.
Save dafuer/18cded971a254dd9e379 to your computer and use it in GitHub Desktop.
Plot from terminal
#!/bin/bash
# This i script shows an example about how to plot data directly copy/paste in the terminal.
# Example of execution:
# ./script.sh
# 1 2 3
# 2 3 4
# CTRL-D
# Then a graph will pop up
input=`cat`
echo "set terminal x11 persist
\$data <<EOD
$input
EOD
plot '\$data' u 1:2 with lines, \
'' u 1:3 with points" | gnuplot -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment