In Unix, how can I plot a graph?

Many Unix systems have Gnuplot installed. Gnuplot features include:

  • Plotting of two-dimensional functions and data points in many different styles, including points, lines, and error bars
  • Plotting of three-dimensional data points and surfaces in many different styles, including contour plot and mesh
  • Support for complex arithmetic
  • User-defined functions
  • Support for a large number of operating systems, graphics file formats, and devices
  • Extensive online help
  • Labels for title, axes, and data points
  • Command-line editing and history on most platforms

To start Gnuplot, at the Unix prompt, enter:

  gnuplot

To invoke online help, enter help at the Unix prompt.

The following commands display a graph of the sin function using a standard terminal:

  gnuplot> set term dumb
  gnuplot> plot [-6:6] sin (x)
Note:
The above information was gleaned from the comp.graphics.gnuplot newsgroup FAQ, which is posted every two weeks to comp.graphics.gnuplot, comp.answers, and news.answers, and is available via anonymous FTP at the FAQ Archives.

This is document adoc in the Knowledge Base.
Last modified on 2015-06-19 00:00:00.

Contact us

For help or to comment, email the UITS Support Center.