gpt4 book ai didi

colors - 管理 gnuplot 中的调色板指示器

转载 作者:行者123 更新时间:2023-12-02 08:46:13 25 4
gpt4 key购买 nike

我想问是否有人知道如何管理gnuplot中的调色板指示器,我希望它适合我的颜色(12)而不是自动添加

我的代码是

 set palette model HSV 
set palette rgb 3,2,2
set palette maxcolors 12
set view map
set size square
set key off
set title "Neural network output (fitted curve)"
set xlabel "x"
set ylabel "y"
set zlabel "z"
set xrange [ -7.6625930750000002 : 27.166801390000000 ]
set yrange [ 0.35422432799999998 : 30.163194489999999 ]
set zrange [ -55.934824620000001 : 2.4059901000000002E-002 ]
set grid
set terminal png size 1200,900
set output "output/fitted_curve.png "
splot "output/plot_data_pl.txt " with points palette pt 7 ps 1

gnuplot output image

最佳答案

为了获得最大的灵 active ,您应该定义自己的调色板
这是我曾经为了获得具有 7 种不同颜色的图而所做的事情。因此,我还可以定义哪种颜色代表给定的值范围。

set palette defined (0 "black",\
0.5 "black",\
0.5 "red",\
1.5 "red",\
1.5 "orange-red",\
2.5 "orange-red",\
2.5 "orange",\
3.5 "orange",\
3.5 "yellow",\
4.5 "yellow",\
4.5 "light-green",\
5.5 "light-green",\
5.5 "green",\
6.5 "green")

enter image description here

因此,您实际上必须定义颜色要跨越的值。
当然,您可以使用 RGB 定义您的颜色。 gnuplot 定义的颜色列表是 here .

为了完整起见,这是我使用的整个代码:

set view map
set pm3d

set term pngcairo crop font 'lmroman10,32' size 1152,864
set border lw 2
set palette defined (0 "black", 0.5 "black", 0.5001 "red", 1.5 "red", 1.5001 "orange-red", 2.5 "orange-red", 2.5001 "orange", 3.5 "orange", 3.5001 "yellow", 4.5 "yellow", 4.5001 "light-green", 5.5 "light-green", 5.5001 "green", 6.5 "green")
set xlab 'time step ' offset 0,1
set xtics 2500 offset 0,0.65
set ylab 'position [cell]' offset +.5,0
set cblab 'velocity [cells/(time step)]' offset -.8,0
set cbtics offset -1.2,0
set xrange[100000:110000]
set yrange[0:10000]
set cbrange[0:6.5]

set style line 1 lt 1 lc rgb "blue" lw .85 pt 6 ps .6

splot '6.csv' u (($1)):($2):($3) w p palette t '', 'data.csv' u (($1)):($2):($3*0) w l ls 1 t '', 'data2.csv' u (($1)):($2):($3*0) w l ls 1 t ''

关于colors - 管理 gnuplot 中的调色板指示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33955878/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com