[R] Alpha not working in geom_rect

Adel adel.daoud at socav.gu.se
Sat Mar 7 18:39:40 CET 2015


Hi 
I am trying to activate the alpha argument to work, but for some reason it
does not to play with me. Anybody has an idea why?


p <- ggplot(data = prediction_df, aes(x=x, y=prediction, fill=threshold)) +
geom_area(colour="black", size=.2, alpha=.4) +
scale_fill_brewer(palette="Set1",
breaks=rev(levels(prediction_df$threshold)))
p + geom_rect(aes(xmin=2, xmax=10, ymin=(0), ymax=(1)), fill="black",
alpha=0.5)


prediction_df
     x prediction  threshold
1  -10  0.5694161       noAF
2   -9  0.5700513       noAF
3   -8  0.5706863       noAF
4   -7  0.5713211       noAF
5   -6  0.5719556       noAF
6   -5  0.5725899       noAF
7   -4  0.5732240       noAF
8   -3  0.5738578       noAF
9   -2  0.5744914       noAF
10  -1  0.5751247       noAF
11   0  0.5757578       noAF
12   1  0.5763906       noAF
13   2  0.5770232       noAF
14   3  0.5776556       noAF
15   4  0.5782876       noAF
16   5  0.5789195       noAF
17   6  0.5795510       noAF
18   7  0.5801823       noAF
19   8  0.5808134       noAF
20   9  0.5814441       noAF
21  10  0.5820747       noAF
22 -10  0.2359140   singleAF
23  -9  0.2356847   singleAF
24  -8  0.2354550   singleAF
25  -7  0.2352249   singleAF
26  -6  0.2349943   singleAF
27  -5  0.2347634   singleAF
28  -4  0.2345321   singleAF
29  -3  0.2343003   singleAF
30  -2  0.2340682   singleAF
31  -1  0.2338356   singleAF
32   0  0.2336027   singleAF
33   1  0.2333694   singleAF
34   2  0.2331357   singleAF
35   3  0.2329016   singleAF
36   4  0.2326671   singleAF
37   5  0.2324322   singleAF
38   6  0.2321969   singleAF
39   7  0.2319613   singleAF
40   8  0.2317253   singleAF
41   9  0.2314889   singleAF
42  10  0.2312522   singleAF
43 -10  0.1946699 multipleAF
44  -9  0.1942640 multipleAF
45  -8  0.1938587 multipleAF
46  -7  0.1934540 multipleAF
47  -6  0.1930500 multipleAF
48  -5  0.1926467 multipleAF
49  -4  0.1922440 multipleAF
50  -3  0.1918419 multipleAF
51  -2  0.1914404 multipleAF
52  -1  0.1910397 multipleAF
53   0  0.1906395 multipleAF
54   1  0.1902400 multipleAF
55   2  0.1898411 multipleAF
56   3  0.1894429 multipleAF
57   4  0.1890453 multipleAF
58   5  0.1886483 multipleAF
59   6  0.1882520 multipleAF
60   7  0.1878564 multipleAF
61   8  0.1874613 multipleAF
62   9  0.1870669 multipleAF
63  10  0.1866732 multipleAF





--
View this message in context: http://r.789695.n4.nabble.com/Alpha-not-working-in-geom-rect-tp4704291.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list