gnuplot - Gnuplot pm3d 绘制“inf”值白色
问题描述
我正在使用这些选项来绘制能量表面的 3D 地图。
set cbrange [-60:60]
set palette maxcolors 13 model RGB defined (0 "#0ab3f7",1 "#4dabec",2 "#6da2df", 3 "#8599d3", 4 "#9a8fc5",5 "#ac84b6", 6 "#bc79a7", 7 "#cc6c95", 8 "#da5d81",9 "#e74c69", 10 "#f3364a", 11 "#f4344
7", 12 "#ff0000")
set cbtics ("-50" -50, "-40" -40, "-30" -30 , "-20" -20, "-10" -10, "0" 0, "10" 10, "20" 20, "30" 30, "40" 40, "50" 50, "inf" 60)
但不能给 inf 值任何颜色。我怎样才能做到这一点 ?
解决方案
如果您的数据实际上包含 Inf 或 -Inf,这应该会自动发生。这是在线演示集合imageNaN.dem中的第一个图。
# This is the first plot from "imageNaN.dem" in the gnuplot demo set
#
set title "Treatment of missing/undefined/NaN/Inf data"
unset key
set tic scale 0
set border 3 front
set cbrange [-2:7]
set cblabel "Score"
set cbtics 0,1,5
set xrange [-0.5:4.5]
set yrange [-0.5:5.5]
set datafile missing "?"
set ytics ("-Inf" 5, "Inf" 4, "NaN" 3, "Junk" 2, "?" 1, "0" 0)
unset xtics
# Define the test data as a named data block
$matrixdata << EOD
0 5 4 3 0
? 2 2 0 1
Junk 1 2 3 5
NaN 0 0 3 0
Inf 3 2 0 3
-Inf 0 1 2 3
EOD
set view map
plot $matrixdata matrix with image
推荐阅读
- r - 在 R 中的列表列表上使用 group_split
- java - 从 Jgit 中的远程分支拉取自证书错误
- r - 从R中的不同时间步减去值
- python - Dash python:如何用 csv 内容填充 dcc.dropdown?
- firebase - 如果我安装了支持 Firebase 的应用程序但我以前从未打开过它,我的手机能否收到 Firebase 推送通知
- ruby-on-rails - 如何防止 RSpec 在带有虚拟应用程序的 Rails 插件中运行规范两次?
- javascript - 为什么“启动”脚本没有运行?
- python - 散点图未以破折号绘制
- azure - 多站点应用程序网关基于路径的路由不向 VM 上的 Apache 发送流量
- cuda - PyTorch - Cuda 错误:没有可在设备上执行的内核映像