Gnuplot color gradients
I need to create a series of vertical gradients on my graph - four in total to refine the direction (N, E, S, W).
#set 0 to 45 degrees color
set obj 1 rectangle behind from screen 0.09,0.2 to screen 0.89,0.29
set palette model RGB defined ( 0 "white", 1 "red")
set cbrange[0:1]
unset colorbox
Am I missing something? thanks in advance
+3
source to share
1 answer
You cannot fill a rectangle with a gradient. palette
only affects built functions or datasets. For this you can use the build style image
or pm3d
.
One example:
set samples 100
set isosample 100,100
set xrange [0:1]
set yrange [0:1]
set palette defined (0 "white", 1 "red")
set autoscale cbfix
unset colorbox
unset key
set multiplot layout 2,2
plot '++' using 1:2:1 with image
plot '++' using 1:2:2 with image
plot '++' using 1:2:(-$1) with image
plot '++' using 1:2:(-$2) with image
unset multiplot
Output with pngcairo terminal and version 4.6.5:
You should now find a way to integrate this with the other charts you have.
+2
source to share