简体   繁体   English

gnuplot scatter plot,带颜色的标签

[英]gnuplot scatter plot, labels with color

i have a file with 4 columns (x value), (y value), (label), (rgb color)我有一个包含 4 列(x 值)、(y 值)、(标签)、(rgb 颜色)的文件

for example例如

1 43.3 JOHN 034143
2 11.6 BRIAN 987654
3 85.2 JOHN 034143
4 72.7 ALEX 765342
5 4.9 PETER 876897
6 42.7 ALEX 765342

i would like to plot each label on the corresponding position (x,y) with the corresponding color.我想 plot 每个 label 在相应的 position (x,y) 上使用相应的颜色。

for example例如

have JOHN be printed at coordinate (1, 43.3) with rgb-color 034143
and have BRIAN be printed at coordinate (2, 11.6) with rgb-color 987654
and have JOHN be printed at coordinate (3, 85.2) with rgb-color 034143
and ...

to be sure, i would also like the labels to be printed vertically (rotated 90 deg):-)可以肯定的是,我还希望标签垂直打印(旋转 90 度):-)

how may i achieve this?我怎样才能做到这一点?

(unfortunately and admittedly, im too dummy to extract/synthesize the exact answer from other similar questions or from the official documentation) (不幸的是,我太笨了,无法从其他类似问题或官方文档中提取/合成确切答案)

Assuming your color values are decimal numbers (rather than hex):假设您的颜色值是十进制数字(而不是十六进制):

$DATA << EOD
1 43.3 JOHN 034143
2 11.6 BRIAN 987654
3 85.2 JOHN 034143
4 72.7 ALEX 765342
5 4.9 PETER 876897
6 42.7 ALEX 765342
EOD
set border 3; set tics nomirror
set xrange [0:*]   

plot $DATA using 1:2:3:4 with labels textcolor rgb variable rotate by 90

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM