← 返回命令列表

Linux command

graph 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Plot data from file

graph [data.txt] > [plot.ps]

Plot with specific range

graph -x [0] [10] -y [0] [100] [data.txt] > [plot.ps]

Create PNG output

graph -T png [data.txt] > [plot.png]

Plot with title

graph --title-font-size [0.05] -L "[My Graph]" [data.txt] > [plot.ps]

Multiple datasets

graph [data1.txt] [data2.txt] > [plot.ps]

说明

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.

参数

-T _type_
Output format: ps, png, gif, svg, X.
-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).

FAQ

What is the graph command used for?

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.

How do I run a basic graph example?

Run `graph [data.txt] > [plot.ps]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -T _type_ do in graph?

Output format: ps, png, gif, svg, X.