I'd like to plot a map with discrete color scheme and a textual color description.
But even though I set the maxcolors to 4, I get 6 colors. My options:
set title "Lit Map for Point X:5.0, Y:14.0 with Compactness: 61.45415361382562"
set terminal pngcairo size 1500,500
set output "img.png"
set autoscale fix
set size ratio -1
set cbrange [0:3]
set palette maxcolors 4
set palette defined (0 "white", 1 "grey", 2 "black", 3 "blue")
set cbtics ("Free" 0,"Shadow" 1,"Environment" 2,"Placed Obstacle" 3)
plot '-' matrix with image
The outcome with maxcolors to 4 & the outcome with maxcolors to 3:
What is wrong when I set maxcolors to 4?




set palette defined (0 "white", 1 "white", 1 "grey", 2 "grey", 2 "black", 3 "black", 3 "blue", 4 "blue")without setting maxcolors? Maybe you also need to setset autoscale cbfix(depends on your actual data). - Christoph