微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

gnuplot colorbox 标签位置

如何解决gnuplot colorbox 标签位置

我将视图地图功能与通常为整数的数据集一起使用。当范围很小时,我会根据整个值的范围来限制颜色的数量。我正在寻找一个选项,将值标签放置在每个颜色框颜色范围的中心。例如,我希望“500”出现在黄色的中心而不是顶部,我希望“498”出现在黑色的中心而不是底部

解决方法

# colorbox centered at screen x=0.9,0.1 < screen y < 0.9
# known range [0:10] allows us to calculate tic positions
# 
set colorbox user origin screen 0.85,0.1 size 0.1,0.8
set cbrange [0:10]

# custom tic labels for the colorbox
unset cbtics
set style textbox opaque border lc "black" margins 0,0

do for [i = 1:9] {
    set label i at screen 0.9,(0.1 + 0.08*i)
    set label i sprintf("%03d",i) center boxed front
}

# some function for which the cbrange makes sense
set palette cubehelix 
set sample 101; set isosample 101; set xyplane 0
f(x,y) = 10*sinc(sqrt(x*x + y*y))

splot f(x,y) with pm3d

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。