LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

graph

2D data plotting utility

TLDR

Plot data from file
$ graph [data.txt] > [plot.ps]
copy
Plot with specific range
$ graph -x [0] [10] -y [0] [100] [data.txt] > [plot.ps]
copy
Create PNG output
$ graph -T png [data.txt] > [plot.png]
copy
Plot with title
$ graph --title-font-size [0.05] -L "[My Graph]" [data.txt] > [plot.ps]
copy
Multiple datasets
$ graph [data1.txt] [data2.txt] > [plot.ps]
copy

SYNOPSIS

graph [options] [files]

DESCRIPTION

graph is part of GNU plotutils, creating 2D plots from data files. It reads x,y coordinates from input and generates publication-quality graphs in various formats including PostScript, PNG, and SVG.The tool supports multiple datasets, various line and symbol styles, and extensive customization for scientific and technical plotting.

PARAMETERS

-T type

Output format: X, png, pnm, gif, svg, ai, ps, cgm, fig, pcl, hpgl, regis, meta, tek. Defaults to meta (GNU graphics metafile, viewable with plot).
-x min max
X-axis range.
-y min max
Y-axis range.
-L label
Top label (title).
-X label
X-axis label.
-Y label
Y-axis label.
-m type
Line mode (0-5).
-S type
Symbol type.
-C
Use color.
-g type
Grid type (0-3).

INPUT FORMAT

$ # Comment line
1 2.5
2 3.7
3 4.2
# Blank line separates datasets

1 1.5
2 2.8
copy

CAVEATS

Part of plotutils package. Limited interactivity. For complex plots, consider gnuplot. The default output type is the GNU metafile format; use -T to select a concrete format such as png, svg, or ps.

HISTORY

graph is part of GNU plotutils, maintained by the GNU project. The package provides a collection of plotting utilities following the Unix philosophy of simple, composable tools.

SEE ALSO

gnuplot(1), plot(1)

Copied to clipboard
Kai