Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparency with polygon command

Tags:

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?

like image 244
Kazo Avatar asked Dec 31 '12 09:12

Kazo


People also ask

How do I make a transparent polygon?

Answer: To make a polygon fill transparent, right click on the feature class in the Table of Contents and then click on Properties. On the Display tab, you can set the percent transparency. Formerly a Mapping Center Ask a Cartographer Q & A.


1 Answers

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) 

enter image description here

like image 200
agstudy Avatar answered Oct 09 '22 21:10

agstudy