简体   繁体   中英

R plot transparent coloured points

I am currently plotting some points onto an existing map of the UK using the following:

points(X$Long, X$Lat, col=X$Col, pch=16,cex=X$Size)

X is the data frame.

The colour of the points varies along with the size.(yellow to orange to red)

I would like the points to be semi transparent so that you can still just about see the lines underneath the points.

What is the easiest way to do this I have already seen some code to alter the colour code but is there an easier way?

Thank you in advance.

Try the argument":

alpha = I(1/2)

Change the ratio inside the parentheses to change the level of the transparency.

You can set the colour transparency within a colour Definition

mycol <- rgb(0, 0, 255, max = 255, alpha = 125, names = "blue50")

as mentioned above the alpha values determines the degree of transparency

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM