用 gnuplot 绘图

从命令行绘制函数和数据图表。

macOS统计图片转换低风险
运行 gnuplot -p -e "plot sin(x)",绘制正弦曲线并保持窗口打开。

01命令

命令
$ gnuplot -p -e "plot sin(x)"

02作用说明

gnuplot 读取命令或表达式并输出达到出版质量的图表,支持 PNG、SVG 等多种格式;dumb 终端甚至能用 ASCII 画简单图,方便通过 SSH 使用。

03风险

风险低风险
系统兼容性macOS with Homebrew installed
!注意: 无头机器上交互窗口终端会失败;请显式选择图片或 dumb 终端。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Homebrew formula: gnuplot
    Homebrew · vendor-doc · 2026-09-20
    依据: Command-driven, interactive function plotting. Packages gnuplot, a portable plotting utility with terminal and image outputs.

最后验证: 2026-09-22 · 分类: 开发者