使用gnuplot的带条件的xtics标签

使用gnuplot的带条件的xtics标签,plot,gnuplot,conditional-statements,labeling,Plot,Gnuplot,Conditional Statements,Labeling,我对使用文件中某列的字符串标记XTIC感兴趣。 文件以以下方式写入: Index Name Status Value 1 Ver1 with 0.3 2 Ver1 without 0.25 3 Ver2 with 0.35 4 Ver3 with 0.27 应使用条件图绘制数据 plot file u (strcol(3) eq "with"?$1:1/0):($4) w p pt 7 notitle XTIC应标有第(2)列中包含的数据。如果使用了所有值,则可通过xticlabel(2)完

我对使用文件中某列的字符串标记XTIC感兴趣。 文件以以下方式写入:

Index Name Status Value
1 Ver1 with 0.3
2 Ver1 without 0.25
3 Ver2 with 0.35
4 Ver3 with 0.27
应使用条件图绘制数据

plot file u (strcol(3) eq "with"?$1:1/0):($4) w p pt 7 notitle
XTIC应标有第(2)列中包含的数据。如果使用了所有值,则可通过
xticlabel(2)
完成此操作。但我只想使用过滤后的数据得到如下图:

|
|     x      x     x
|     
----------------------------
    ver1   ver2   ver3
问题是:如何仅使用过滤后的值来标记XTIC


提前谢谢

您也可以在
xticlabel
中施加相同的条件,即如果需要,使用第2列或传递未定义的值:

plot 'file.dat' u \
  (strcol(3) eq "with"?$1:1/0):4:xticlabel((strcol(3) eq "with")?strcol(2):1/0) \
  w p pt 7 notitle

您也可以在
xticlabel
中施加相同的条件,即如果需要,使用第2列或传递未定义的值:

plot 'file.dat' u \
  (strcol(3) eq "with"?$1:1/0):4:xticlabel((strcol(3) eq "with")?strcol(2):1/0) \
  w p pt 7 notitle

很好。谢谢!很好。谢谢!