我本周刚开始在gnuplot中阅读有关调色板和pm3d的信息。我有些困惑。
是否有一种简单的方法来绘制对象(例如矩形),该对象在调色板的光谱中充满了颜色,即对象的fillcolor
选项值由调色板的光谱给出?还是我必须使用splot?
我在网上找不到任何东西,也对此没有任何疑问...
如果您希望使用Powerpoint风格的渐变色,可以通过创建多图来将其切入gnuplot中,其中一个图是一个小的矩形图:
#!/usr/bin/env gnuplot
set terminal pngcairo enhanced rounded
set output 'gradient.png'
set samples 1000 # for smooth gradient
set multiplot
# plot actual data
plot sin(x)
# set up plot for a rectangle with no decoration
set pm3d map
unset border
unset tics
unset key
unset colorbox
set margin 0
set size 0.2,0.3
# creates a left-to-right gradient
set origin 0.6,0.6
splot x
# creates a top-to-bottom gradient
set origin 0.3,0.3
splot y
# creates a bottom-left to top-right gradient
set origin 0.3,0.6
splot x + y
# and so on
set origin 0.6,0.3
splot x - y
unset multiplot
结果:
有关更多启发,请参阅:http : //gnuplot.sourceforge.net/demo/pm3d.html http://www.gnuplotting.org/tag/colormap/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句