如何防止标签重叠

时间:2011-01-24 22:36:43

标签: gnuplot

我正在运行以下命令在gnuplot中绘制几个X,Y点:

使用($ 2 + 3)绘制“Output.tsv”:( $ 3 + 3):1带标签,“Output.tsv”使用2:3

某些数据点彼此非常接近,这使得标签不可读。有没有办法让gnuplot消除/减少标签之间的重叠?

enter image description here

1 个答案:

答案 0 :(得分:5)

我认为您可以考虑3个选项:

1)使你的图表变得庞大并希望你的标签不重叠 2)将点绘制为不同的系列,每个项目都有自己的图例 3)使用字母而不是标签,你可以使用

在每个点放一个字母
plot "???" using 1:2
plot "" using 1:2:(stringcolumn(3) ne 'compare to' ? 'if equal' : 'if not equal' ) with labels

stringcolumn函数在第3列中查找,将值与字符串'compareto'进行比较,如果有匹配,则在该位置放置'if equal',否则'if equal equal'

因此,我在图表中看到类似Simulator的东西,你可以保留绿点并使用

在其上放一个S
plot "" using 1:2:(stringcolumn(3) ne 'Simulator' ? 'S' : '' ) with labels

我希望这会有所帮助。

相关问题