scale_identity {ggplot2} | R Documentation |
Don't remap values, use directly
scale_colour_identity(name=NULL, breaks=NULL, labels=NULL, ...) scale_fill_identity(name=NULL, breaks=NULL, labels=NULL, ...) scale_size_identity(name=NULL, breaks=NULL, labels=NULL, ...) scale_shape_identity(name=NULL, breaks=NULL, labels=NULL, ...) scale_linetype_identity(name=NULL, breaks=NULL, labels=NULL, ...)
name |
name of scale to appear in legend or on axis |
breaks |
numeric vector indicating where breaks should lie |
labels |
character vector giving labels associated with breaks |
... |
ignored |
This page describes scale_identity, see layer
and qplot
for how to create a complete plot from individual components.
A layer
Hadley Wickham, http://had.co.nz/
## Not run: colour <- c("red","green","blue","yellow") qplot(1:4, 1:4, fill=colour, geom="tile") qplot(1:4, 1:4, fill=colour, geom="tile") + scale_fill_identity() # To get a legend, you also need to supply the labels to # be used on the legend, and the grob to draw them: # grob_tile, grob_line, or grob_point qplot(1:4, 1:4, fill=colour, geom="tile") + scale_fill_identity(labels=letters[1:4], guide="tile", name="trt") # cyl scaled to appropriate size qplot(mpg, wt, data=mtcars, size = cyl) # cyl used as point size qplot(mpg, wt, data=mtcars, size = cyl) + scale_size_identity() ## End(Not run)