Skip to content

Instantly share code, notes, and snippets.

@nisrulz
Created August 3, 2015 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nisrulz/9ef28bd6e56492f7d00f to your computer and use it in GitHub Desktop.
Save nisrulz/9ef28bd6e56492f7d00f to your computer and use it in GitHub Desktop.
Use gunplot in terminal to plot a graph
#For more info check : http://people.duke.edu/~hpgavin/gnuplot.html
#Install GnuPLot
brew install gnuplot
#Before ploting a graph, set the terminal into dumb mode
set terminal dumb
#To Plot a graph
plot cos(x+2) #for a function
#for a data set
plot "./data.csv"
#To save the graph to a file , type the following commands into the terminal after you have plotted your graph
#Set terminal into png mode
set term png
#Set output file
set output "graph.png"
#Replot the graph
replot
#Set the terminal back into dumb mode
set term dumb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment