plot - 如何改进以下 gnu 图?

标签 plot gnuplot

我有以下 gnu 图:

#  automobile_input.txt
#
set term png
set output "automobile.png"
#
#  Fields in each record are separated by commas.
#
set datafile separator ","

    set title "Price versus Curb weight"
    set xlabel "Price in dollars"
    set ylabel "Curb weight in pounds"
    set grid
    plot 'x' using 1:2
    quit

x 是一个包含数字的文件,例如

   1,2
   0.5,4

等等

我想对此图进行一些更改。

在图的顶部有“x using 1:2”,我想删除它。

最后,最重要的事情:我想添加另一个文件,y,以相同的格式,它也将绘制在同一个图上,只是具有不同的符号和颜色(而不是红色的加号),例如,蓝色三角形。我更希望优点是圆形。

最佳答案

在绘图线中使用 notitle 省略数据系列标题。添加另一条曲线可以这样完成:

plot 'x' using 1:2 notitle, \
     'y' using 1:2 notitle

数据系列点会自动调整。要手动指定格式,您可以使用如下所示的内容进行绘图:

 plot 'x' using 1:2 with points pointtype 6 linecolor rgb 'red'  title "Data X", \
      'y' using 1:2 with points pointtype 8 linecolor rgb 'blue' title "Data Y"

您通常会在网上看到将这些命令缩写为如下的脚本:

 plot 'x' w p pt 6 lc rgb 'red'  title "Data X", \
      'y' w p pt 8 lc rgb 'blue' title "Data Y"

关于plot - 如何改进以下 gnu 图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38668267/

相关文章:

python - 使用 hexbin 的 Pairplot

r - 如何将回归线添加到具有多个按因子颜色编码的数据系列的图中?

python - 你如何制作 numpy 数组的 ggplot 图?

date - Gnuplot,如何在标题或图例中绘制月份?

java - JavaPlot 中的 "With lines"?

plot - 在 gnuplot 中的阶跃函数下填充

python - 将 Matplotlib 轮廓 2D 和 1D 图中的 X 轴与颜色条图例对齐并共享

r - R 图中的下标

graph - gnuplot:在其他规则的 tic 间隔中插入自定义 xtic 标签

matlab - Octave 图形格式化工具