I used the polygon
command in R which created an area in the plot. However, the values in this area are not shown whereas the main aim is to monitor these values. Does anyone know how to handle this?
Asked
Active
Viewed 3.8k times
26

Ben Bolker
- 211,554
- 25
- 370
- 453

Kazo
- 1,205
- 3
- 15
- 15
-
Helps if you include a bit of code to illustrate your problem. – Spacedman Dec 31 '12 at 20:30
2 Answers
50
You can use The function rgb()
to specify a color with an alpha transparency.
for example :
xx <- c(1:50)
yy <- rnorm(50)
n <- 50
hline <- 0
plot (yy ~ xx, type="n", axes=FALSE, ann=FALSE)
text(x=xx,y=min(yy)+max(yy),labels='a')
polygon(c(xx[1], xx, xx[n]), c(min(yy), yy, min(yy)),
col=rgb(1, 0, 0,0.5), border=NA)

agstudy
- 119,832
- 17
- 199
- 261
-
26another convenient possibility is something like `adjustcolor("red",alpha.f=0.5)` – Ben Bolker Dec 31 '12 at 16:20
-
13
Another convenient possibility for making a lighter/more-transparent version of an existing color is to use adjustcolor()
, something like
adjustcolor("red", alpha.f=0.5)

Ben Bolker
- 211,554
- 25
- 370
- 453