Bubble Map with Transparent Bubble

92 views
Skip to first unread message

Brian Wahl

unread,
Jan 26, 2016, 9:27:36 AM1/26/16
to rworldmap
First, this is a great package! I could see myself using this for all kinds of things. Thank you to whoever built it. 

What I am trying to do now is create a map with countries colored by disease rate categories and transparent bubbles overlaid to represent the absolute number of disease cases. I was able to get the disease rate categories by specifying the cut points with classIntervals. And I was also able to overlay the bubbles by setting the "add" argument equal to "TRUE". However, I cannot for the life of me figure how to change the transparency for for the bubbles. I would be happy with just transparent (alpha = 0.65) grey circles, but in an ideal world, I would love transparent grey circles (alpha = 0.65) with darker edges to the bubbles. Is this possible?  

Andy South

unread,
Feb 1, 2016, 8:46:44 AM2/1/16
to rworldmap
Thanks !

From the github (soon to be on CRAN) version mentioned in the previous post what you want to do should be possible with something like the following slight hack :

#filled bubbles with set transparency
mapBubbles(fill=TRUE,colourPalette=adjustcolor(palette(), alpha.f = 0.5))

#add bubble edge of a single colour (also with option to set transparency
mapBubbles(nameZColour = adjustcolor('black', alpha.f = 0.7), fill=FALSE, add=TRUE)

Note that some may also be possible and/or easier with the packages tmap & ggplot2.

Best,
Andy
Reply all
Reply to author
Forward
0 new messages