Reputation: 473
I'm facing some difficulties to set my background plot with some transparency. simply, whenever I set alpha to any value, same opaque background is returned. Although there is some posts regarding background highlighting such as
customize background to highlight ranges of data in ggplot
How to highlight time ranges on a plot?
But unfortunately, this issue is not discussed here or there. I would appreciate your comments
Here is some data for demo
install.packages("ggplot2")
First , using geom_rect
ggplot(mtcars, aes(x=wt, y=qsec)) +
geom_point(color="black",size=8) +
theme_bw() +
geom_rect(aes(xmin=4,xmax=5,ymin=14,ymax=Inf),alpha=0.9,fill="green")
Playing with alpha wont help and ultimately, that is what I got
Using annotate
function , I can not generate it also.
Upvotes: 0
Views: 2138