HOME

TheInfoList



OR:

In
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, an ...
, graph is a
command-line A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
utility used to draw plots from tabular data.


History

The graph utility, written by
Douglas McIlroy Malcolm Douglas McIlroy (born 1932) is a mathematician, engineer, and programmer. As of 2019 he is an Adjunct Professor of Computer Science at Dartmouth College. McIlroy is best known for having originally proposed Unix pipelines and developed se ...
, was present in the first version of Unix, and every later version, for instance: * Unix Version 7, released in 1979 * SunOS 5.10, the Solaris version released in 2005 Its output is a sequence of commands for the plot utility, which creates
plot Plot or Plotting may refer to: Art, media and entertainment * Plot (narrative), the story of a piece of fiction Music * ''The Plot'' (album), a 1976 album by jazz trumpeter Enrico Rava * The Plot (band), a band formed in 2003 Other * ''Plot' ...
s using ASCII graphics. This design demonstrates the
Unix philosophy The Unix philosophy, originated by Ken Thompson, is a set of cultural norms and philosophical approaches to minimalist, modular software development. It is based on the experience of leading developers of the Unix operating system. Early Unix de ...
: defining the plot (graph) and drawing it (plot) are separate tools, so they can be recombined with other tools. For instance, plot can be substituted with a different utility, that accepts the same plot commands, but creates the plot in a graphics file format, or sends it to a plotter. Unix v7 also provided device drivers for plotting the results to various graphics devices; this was announced as ''now standard''. The GNU plotutils package provides a free non-exact reimplementation, available for
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
and many other systems. It can create plots in various graphics formats.


Usage

In its simplest use, the graph utility takes a textfile containing pairs of numbers, indicating the points of a line plot. It outputs the line plot. Several options can be supplied to modify its behavior.


Example (Unix)

Graph (SunOS 5.10) demo, part 1 of 2 - input and execution.png , Preparing example input and running graph with plot Graph (SunOS 5.10) demo, part 2 of 2 - output.png , The results These screenshots demonstrate basic operation on SunOS 5.10, on which graph and plot come preinstalled. The example input is from the first example in the GNU plotutils manual.


Example (GNU plotutils)

Graph (Ubuntu 14.04 Linux) demo, part 1 of 2 - input and execution.png , Preparing example input and running graph in Tektronix mode Graph (Ubuntu 14.04 Linux) demo, part 2 of 2 - output.png , The results These screenshots demonstrate the GNU plotutils version of graph when run in an
xterm In computing, xterm is the standard terminal emulator for the X Window System. It allows users to run programs which require a command-line interface. If no particular program is specified, xterm runs the user's shell. An X display can sho ...
, exploiting xterm's ability to emulate a
Tektronix 4010 The Tektronix 4010 series was a family of text-and-graphics computer terminals based on storage-tube technology created by Tektronix. Several members of the family were introduced during the 1970s, the best known being the 11-inch 4010 and 19-inc ...
plotter. This demo was run on
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
, which makes GNU plotutils available as an optional package; many other Linux distributions and other Unix-like systems do the same.


References


External links

{{Unix commands Command-line software Unix software