gnuplot散点图,带有颜色的标签 [英] gnuplot scatter plot, labels with color

查看:85
本文介绍了gnuplot散点图,带有颜色的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件,该文件有4列(x值),(y值),(标签)和(RGB颜色)

i have a file with 4 columns (x value), (y value), (label), (rgb color)

例如

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

我想用相应的颜色在相应的位置(x,y)上绘制每个标签.

i would like to plot each label on the corresponding position (x,y) with the corresponding color.

例如

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 ...

当然,我也希望标签垂直打印(旋转90度):-)

to be sure, i would also like the labels to be printed vertically (rotated 90 deg) :-)

我该如何实现?

(不幸的是,我实在太虚伪了,无法从其他类似问题或官方文档中提取/综合确切答案)

(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

这篇关于gnuplot散点图,带有颜色的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆