[R] Choosing the number of colour breaks in ggplot2

Karl Ove Hufthammer Karl.Hufthammer at math.uib.no
Sun Jul 15 18:14:44 CEST 2007

Fredag 13. juli 2007 skreiv hadley wickham:

> There's no official way to do it, but you can "hack" the colour
> gradient scale to do what you want:
> # Create a modified scale
> gr <- scale_fill_gradient2()$clone()
> gr$breaks <- function(.) seq(-100, 100, by=10)

Thank you so much. It works perfectly.

Karl Ove Hufthammer

More information about the R-help mailing list