You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Bash中绘制带指定X/Y轴标题的Gnuplot图表

Plotting a Rate-Distortion Curve with Gnuplot

Got it, here's how you can create that rate-distortion curve using your data file with Gnuplot:

You have two straightforward options to generate the plot—interactive mode for tweaking, or a one-line terminal command for quick execution.

Option 1: Interactive Gnuplot Session

  1. Open Gnuplot by typing gnuplot in your terminal.
  2. Enter these setup commands one by one to configure your plot:
    set title "Rate Distortion Curve"
    set xlabel "bit rates"
    set ylabel "psnr"
    set grid
    
  3. Then plot your data with lines and points (this makes the curve clear while highlighting individual data points):
    plot 'data' with lp
    
    The plot window will stay open until you close it, and you can tweak settings (like axis ranges) and re-run replot if needed.

Option 2: One-Line Terminal Command

If you want to skip the interactive session and generate the plot in one go, use this command:

gnuplot -p -e "set title 'Rate Distortion Curve'; set xlabel 'bit rates'; set ylabel 'psnr'; set grid; plot 'data' with lp"

A quick breakdown of the flags:

  • -p: Ensures the plot window stays open after Gnuplot finishes (otherwise it closes immediately).
  • -e: Lets you pass all Gnuplot commands directly as a single string.

Just make sure your data file is in the same directory where you run the command, or replace 'data' with the full path to the file (e.g., '/home/yourname/documents/data') if it's stored elsewhere.

内容的提问来源于stack exchange,提问作者John

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:18:04