Gnuplot:使用 xticlabels 和线点为每个点绘制不同的颜色
Gnuplot: Plotting different colors to each point using xticlabels and linepoints
我正在尝试用线点绘制图表,第一列是一个字符串,我需要使用 xticlabels 将数据绘制到与之相关的第二列。
这是我的数据文件,第三列我希望使用设置点颜色
"0000" 0 0
"0001" 9 0
"0010" 16 0
"0011" 25 1
"0100" 14 0
"0101" 23 0
"0110" 30 0
"0111" 39 1
"1000" 30 0
"1001" 39 0
"1010" 46 2
"1100" 44 0
我用过:
set palette defined (0 "blue", 1 "yellow", 2 "red")
plot "data.dat" using 2:xticlabels(1) with linespoints ls 1 notitle
如何更改此命令以绘制每个点颜色以使用适当的点颜色?
提前致谢
如果我没理解错的话,这就是你需要的:
plot "data.dat" using 0:2:3:xticlabels(1) with linespoints ls 1 lc palette notitle
我正在尝试用线点绘制图表,第一列是一个字符串,我需要使用 xticlabels 将数据绘制到与之相关的第二列。
这是我的数据文件,第三列我希望使用设置点颜色
"0000" 0 0
"0001" 9 0
"0010" 16 0
"0011" 25 1
"0100" 14 0
"0101" 23 0
"0110" 30 0
"0111" 39 1
"1000" 30 0
"1001" 39 0
"1010" 46 2
"1100" 44 0
我用过:
set palette defined (0 "blue", 1 "yellow", 2 "red")
plot "data.dat" using 2:xticlabels(1) with linespoints ls 1 notitle
如何更改此命令以绘制每个点颜色以使用适当的点颜色?
提前致谢
如果我没理解错的话,这就是你需要的:
plot "data.dat" using 0:2:3:xticlabels(1) with linespoints ls 1 lc palette notitle