Skip to content
Prev 247892 / 398503 Next

spacing of color key in filled.contour

I've gotten good results using the sine function to map colors. 
For example, when plotting x, map the range(x) to (-pi/2,pi/2) 
which the sine will transform to (-1,1), then add 1 and multiply by 
half the desired number of colors.  Now the integer values will 
pick the colors and give a pleasing display.

If the "squeeze" is taking place only over one of the tails (which 
sounds like your case) map the range from (0,pi/2) or (-pi/2,0) and 
make the necessary scaling adjustments to cover the number of 
colors desired.

Essentially, you are transforming the color mapping instead of 
transforming your data.

Clint