Gnuplot:绘制具有可变点大小和颜色的二维图形

Gnuplot: plot 2D graph with variable points sizes and colors

我一直在尝试用大小和颜色取决于输入的点来绘制散点数据。我已经检查了其他一些示例,然后我开始写这个,但后来我收到了错误消息

plot '-' using 1:2:3:4:5 with labels hypertext point pt 7 ps var lc rgb variable    
     Too many using specs for this style

我错过了什么?我知道带有标签和点大小的图可以很好地使用 4 列,即 1:2:3:4,但是一旦我添加第 5 个输入,就会出现错误。

这只是告诉您,您不能在 labels 绘图样式中使用可变点大小和可变颜色。

作为解决方法,您可以先使用白色作为点颜色绘制带有超文本的标签,然后是彩色点。

plot 'data.txt' using 1:2:3:4 with labels hypertext point pt 7 ps var lc rgb 'white',\
 '' using 1:2:4:5 with points pt 7 ps var lc rgb variable

请注意,使用此解决方案,如果您从标准输入读取数据,则必须发送两次数据。