我想绘制分类结果并标记真实类。所以,基本上我需要的是为字符串列中的值为每个点分配一个颜色。gnuplot:在一列中绘制具有基于颜色的值的点
数据集是这样的:
5.1 3.5 1.4 0.2光圈,setosa
我结束了脚本以下解决方案(感谢在这里的答案:How to make points one color when a third column equals zero, and another color otherwise, in Gnuplot?)
set palette model RGB defined (0 "red",1 "blue", 2 "green")
plot 'iris.data' using 1:2:5 notitle with points pt 2 palette
在原始数据集中我用数字替换了字符串标签,因为我不知道如何在gnuplot中使用字符串。有没有办法如何将字符串映射到颜色?
目前的输出是这样的:
但是我不喜欢梯度调色板,因为它不会在这种情况下才有意义。我宁愿使用单一颜色和班级名称的普通传说。任何想法如何做到这一点?
我有同样的问题。如果gnuplot调色板接受了字符串而不是整数,那将会很好。我不认为它确实如此。 – 2013-01-25 08:57:37