Skip to content
Prev 320144 / 398503 Next

ggplot2 will not draw a rectangle. Error: ggplot2 doesn't know how to deal with data of class XXX"

Hello,

You're forgeting to tell gfeom_rect that the x and y aesthetics are 
already set elsewhere. You must include NULL, NULL as the first two 
arguments:

p + geom_rect(data = rectlib,
	aes(NULL, NULL, xmin = xmin, xmax = xmax, ymin = -Inf, ymax = Inf),
	fill='red', alpha=0.2)


Hope this helps,

Rui Barradas

Em 22-03-2013 21:01, John Kane escreveu: