changing range of color scale on levelplot
Asked Answered
L

1

5

I want to do a little tweeking to an image. My command to generate a simple heatmap of correlations is as follows:

psticorr <- cor(psti)
rgb.palette <- colorRampPalette(c("blue", "yellow"), space = "lab")
levelplot(psticorr, col.regions=rgb.palette(120), scales=list(x=list(cex=.3), y=list(cex=.3)), main="PstI: Correlations of loci coverage", xlab="Samples", ylab="Samples" )

I get what I need but I would really like if I could set the range of the color scale e.g from 0 to 1, at the moment it starts at my lowest correlation (r) value.

Lineage answered 16/7, 2012 at 14:20 Comment(0)
M
9

You can control the color break points in levelplot with the at argument. Try something like at=seq(min(psticorr), max(psticorr), length.out=120)

Mingrelian answered 16/7, 2012 at 15:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.