colors

您所在的位置:网站首页 轮廓线条颜色怎么设置 colors

colors

2024-07-09 12:15| 来源: 网络整理| 查看: 265

我正在绘制数据,如上一个 Stackoverflow 问题中所述: gnuplot 2D polar plot with heatmap from 3D dataset - 可能吗? 大多数情况下它对我来说效果很好,我只关注一些小细节。其中之一是如何控制等高线颜色和线宽。网上有很多关于使用的帖子,set style increment user然后是用户风格的定义set style line 1 lc rgb "blue" lw 2等等。理论上,这应该强制 splot 使用新定义的样式绘制线条。我试过了,但没有用。此外,当我通过 gnuplot 安装访问帮助页面时,我发现我的版本已弃用此用法(版本 4.7 补丁级别 0 上次修改时间为 2013-07-25)。建议改用 set linetype,它会永久更改当前调用 gnuplot 的 gnuplot 线条样式的特征。杀死并重新启动 gnuplot 会恢复默认的线型特征。

接下来,我重新启动了 gnuplot,重新生成了绘图,而没有重新定义轮廓线的任何线条样式或类型。当我查看我的绘图时,我可以看到线条颜色以青色开始,然后是紫色,然后是蓝色(例如,线条类型 5、4、3 或 14、13、12 等)。似乎线条类型正在通过可用样式向后退。好吧,我想,我可以改变那些并忍受奇怪的行为。但是,在发出多个设置线型命令将所有这些线型更改为明显不同的东西之后(我通过运行test命令验证了这些,绘图上的等高线仍然具有与以前相同的颜色和线宽。我可以'似乎不知道轮廓线使用什么线型,所以我无法更改适当的线型。

也许这种奇怪的行为是轮廓线类型的结果,set cntrparam levels increment -6,-6,-24而负值和/或负增量导致一些不可预测的行为?

我想知道如何知道该图中的等高线将使用哪种线型,以及如果用于构建曲面图的线数发生变化,这是否会改变。例如,下图使用 13 条“线”生成曲面,使用set pm3d map. 因此,假设 N=13 行 - 第一个轮廓线型是否遵守规则?例如,我会始终确定等高线样式将从 N=14 开始吗?我想知道当我的输入数据中“线”的数量会发生变化时,第一条和后续等高线将使用哪种线型。

底线是我需要对用于每个轮廓级别的轮廓线应用某种样式。当输入数据发生变化时,我希望对每个级别始终使用相同的样式。该图将始终使用同一组等高线水平:-6、-12、-18 和 -24。绘图数据将始终具有大约 0 的最大“z”坐标并从那里减小。

Gnuplot 命令如下所示。该图的数据集可以在这里下载:http: //audio.claub.net/temp/new_test.dat

reset set terminal pngcairo size 800,800 set output '3d-polar.png' set lmargin at screen 0.05 set rmargin at screen 0.85 set bmargin at screen 0.1 set tmargin at screen 0.9 set pm3d map interpolate 20,20 unset key set multiplot # plot the heatmap set cntrparam bspline set cntrparam points 10 set cntrparam levels increment -6,-6,-24 set contour surface #set style increment user #NOTE: the commented out lines do not seem to affect color or width of the the contour lines no matter what number I use for the linetype #set linetype 8 lc rgb "blue" lw 2 #set linetype 9 lc rgb "black" lw 1 #set linetype 10 lc rgb "orange" lw 1 #set linetype 11 lc rgb "yellow" lw 1 set palette rgb 33,13,10 #rainbow (blue-green-yellow-red) set cbrange [-18:0] unset border unset xtics unset ytics set angles degree r = 3.31 #This number is Log10(max frequency) - Log10(min frequency) of the polar frequency grid set xrange[-r:r] set yrange[-r:r] set colorbox user origin 0.9,0.1 size 0.03,0.8 splot 'new_test.dat' # now plot the polar grid only set style line 11 lc rgb 'black' lw 2 lt 0 set grid polar ls 11 set polar set logscale r 10 set rrange[10:20000] unset raxis set rtics format '' scale 0 #set rtics axis scale set rtics (20,50,100,200,500,1000,2000,5000,10000,20000) do for [i=-150:180:30] { dum = r+0.15+0.05*int(abs(i/100))+0.05*int(abs(i/140))-0.05/abs(i+1) set label i/30+6 at first dum*cos(i), first dum*sin(i) center sprintf('%d', i) } set label 20 at first 0, first -(log(20)/log(10)-1) center "20" set label 100 at first 0, first -(log(100)/log(10)-1) center "100" set label 200 at first 0, first -(log(200)/log(10)-1) center "200" set label 1000 at first 0, first -(log(1000)/log(10)-1) center "1k" set label 2000 at first 0, first -(log(2000)/log(10)-1) center "2k" set label 10000 at first 0, first -(log(10000)/log(10)-1) center "10k" set label 20000 at first 0, first -(log(20000)/log(10)-1) center "20k" plot NaN w l unset multiplot unset output

无法控制等高线的图如下所示。我需要能够为轮廓线指定线条颜色和宽度。如何?

具有默认等高线样式的极谱图



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3