当前位置: 动力学知识库 > 问答 > 编程问答 >

r - How to get a smooth gradient color bar?

问题描述:

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:

分享给朋友:
您可能感兴趣的文章:
随机阅读: