简体   繁体   English

如何在gnuplot中为正值和负值设置colorbox

[英]how to set colorbox for positive and negative values in gnuplot

I would like to set palette rgbformulae in such way that, the colors will be distributed in positive and negative values equally. 我想以这样的方式设置调色板rgbformulae,颜色将以正值和负值均匀分布。 I want to go from blue (negative values) to 0 (white), to red (positive values). 我想从蓝色(负值)到0(白色)到红色(正值)。 I can't able to change the rgbformulae for that. 我无法为此更改rgbformulae。

 set cbrange [-5:5]
 set palette maxcolors 10
 set palette rgbformulae ? ? ?

There is the set palette defined (zrgb, ...) command which can be used to explicitly set colors (rgb) at specific z-values. set palette defined (zrgb, ...)set palette defined (zrgb, ...)命令,可用于在特定的z值显式设置颜色(rgb)。 Gnuplot will interpolate the colors in between. Gnuplot将插入两者之间的颜色。

I skipped the set palette maxcolors 10 , but the following might be a starting point: 我跳过了set palette maxcolors 10 ,但以下可能是一个起点:

set xrange [-1:1]
set yrange [-1:1]
set zrange [-5:5]

set pm3d map
set cbrange [-5:5]
set palette defined (-5 0 0 1, 0 1 1 1, 5 1 0 0)

set terminal png
set output 'colors.png'
splot 5*x

蓝色,白色,红色

I'm using Gnuplot 4.6.6 on Debian Jessie. 我在Debian Jessie上使用Gnuplot 4.6.6。

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

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