I am working on image processing in R. I am using a specific color scheme for my images. To represent the color bar along with the image, I get the color bar divided in sections, as shown in the image below. Is there a way to get a smooth gradient color bar? Here is the code which I am using:
s <- seq(from=range[1], to=range[2], by=0.1)
levelplot(t(m), scales=list(tick.number=0), xlab=" ", ylab=" ", colorkey = list(at=s, labels=as.character(s)),col.regions = two.colors(n=256, start='red', end='blue',middle='black'), main=main)
This is smooth gradient bar which I am trying to get: