选择绘图风格
明确选择
通常使用 with 关键字选择绘图样式,例如
plot x with points
这允许为每个 plot 使用不同的绘图样式:
plot x with points, 2*x with lines
在 gnuplot 命令窗口中键入 help with 会给出所有可用绘图样式的列表。
全局绘图风格选择
也可以为所有绘图命令全局设置绘图样式。这里,gnuplot 区分功能和数据图,可以设置不同的默认样式。
对于功能使用 set style function:
set style function linespoints
plot x, 2*x
对于数据文件使用 set style data:
set style data lines
plot 'file.dat', 'other-file.dat'
注意,对于函数,默认样式是 lines,对于数据文件,它是 points。使用 show style data 和 show style function,你可以检查当前选择的绘图样式。