scale_hue

scale_colour_hue(name=NULL, h=c(0, 360) + 15, l=65, c=100, limits=NULL, breaks=NULL, labels=NULL, h.start=0, direction=1, formatter=identity, ...)
scale_fill_hue(name=NULL, h=c(0, 360) + 15, l=65, c=100, limits=NULL, breaks=NULL, labels=NULL, h.start=0, direction=1, formatter=identity, ...)

Qualitative colour scale with evenly spaced hues

This page describes scale_hue, see layer and qplot for how to create a complete plot from individual components.

What do you think of the documentation? Please let me know by filling out this short online survey.

Parameters

Parameters control the appearance of the scale. In addition to the parameters listed below (if any), any aesthetic can be used as a parameter, in which case it will override any aesthetic mapping.

Returns

This function returns a scale object.

Examples

> dsamp <- diamonds[sample(nrow(diamonds), 1000), ] 
> (d <- qplot(carat, price, data=dsamp, colour=clarity)) 
  
>  
> # Change scale label 
> d + scale_colour_hue() 
  
> d + scale_colour_hue("clarity") 
  
> d + scale_colour_hue(expression(clarity[beta])) 
  
>  
> # Adjust luminosity and chroma 
> d + scale_colour_hue(l=40, c=30) 
  
> d + scale_colour_hue(l=70, c=30) 
  
> d + scale_colour_hue(l=70, c=150) 
  
> d + scale_colour_hue(l=80, c=150) 
  
>  
> # Change range of hues used 
> d + scale_colour_hue(h=c(0, 90)) 
  
> d + scale_colour_hue(h=c(90, 180)) 
  
> d + scale_colour_hue(h=c(180, 270)) 
  
> d + scale_colour_hue(h=c(270, 360)) 
  
>  
> # Vary opacity 
> # (only works with pdf, quartz and cairo devices) 
> d <- ggplot(dsamp, aes(carat, price, colour = clarity)) 
> d + geom_point(alpha = 0.9) 
  
> d + geom_point(alpha = 0.5) 
  
> d + geom_point(alpha = 0.2) 
  

What do you think of the documentation? Please let me know by filling out this short online survey.