Gnuplot 即使对于无数据系列,我也可以强制输入图例吗?

Gnuplot 即使对于无数据系列,我也可以强制输入图例吗?,gnuplot,Gnuplot,我的Gnuplot 4.4正在从N个文件打印数据,每个文件都有未知数量的NAN(不会打印)。我使用了以下“技巧”使所有数据看起来都是同一数据系列的一部分: plot "fileA.dat" using 1:2 linecolor rgbcolor #FF0000 title 'My data', \ "fileB.dat" using 1:2 linecolor rgbcolor #FF0000, \ "fileC.dat" using 1:2 linecolor rg

我的Gnuplot 4.4正在从N个文件打印数据,每个文件都有未知数量的NAN(不会打印)。我使用了以下“技巧”使所有数据看起来都是同一数据系列的一部分:

plot  "fileA.dat" using 1:2 linecolor rgbcolor #FF0000 title 'My data', \
      "fileB.dat" using 1:2 linecolor rgbcolor #FF0000, \
      "fileC.dat" using 1:2 linecolor rgbcolor #FF0000
请注意,颜色是相同的,标题只针对第一个文件

但是,如果
fileA.dat
只有NAN(或由于任何其他原因不包含可绘图信息),则该系列将被忽略,并且我根本没有得到标题


我是否可以让fileA.dat的图例条目显示出来,或者是否有更好的方法在系列中“共享”图例条目?假设我没有比这里声明的更多的信息,在调用
plot

之前,您可以在“不可见函数”上设置标题,如下所示:

plot  "fileA.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      "fileB.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      "fileC.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      NaN linecolor rgbcolor "#FF0000" title "My data"

还可以修改显式“NaN”的线型。

您可以在“不可见函数”上设置标题,如下所示:

plot  "fileA.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      "fileB.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      "fileC.dat" using 1:2 linecolor rgbcolor "#FF0000" notitle, \
      NaN linecolor rgbcolor "#FF0000" title "My data"

还可以修改显式“NaN”的线型。

Genius.)我从来没有想过尝试这个,因为只有NaNs的“文件”输入抹掉了那个系列的标题。真奇怪!至关重要的是,我可以拥有任意多个“虚拟”系列,因此这可以很好地扩展多个(N)逻辑数据集(超过N*M个文件)。Genius.)我从来没有想过尝试这个,因为只有NaNs的“文件”输入抹掉了那个系列的标题。真奇怪!至关重要的是,我可以拥有任意多个“虚拟”系列,因此这可以很好地扩展多个(N)逻辑数据集(超过N*M个文件)。