[R] proportional symbol map ggplot
Strategische Analyse CSD Hasselt
csd.sa at fedpolhasselt.be
Mon Mar 14 15:41:44 CET 2011
Hello,
we want to plot a proportional symbol map with ggplot. Symbols' area should
have the same proportions as the scaled variable.
Hereby an example we found on
http://www.r-bloggers.com/bubble-chart-by-using-ggplot2/ . In this example
we see the proportions of the symbols' area are different from the
proportions of the scaled variable:
crime <-
read.csv("http://datasets.flowingdata.com/crimeRatesByState2008.csv",
header=TRUE, sep="\t")
p <- ggplot(crime, aes(murder,burglary,size=population, label=state))
p <- p+geom_point(colour="red") +scale_area(to=c(1,20))+geom_text(size=3)
Example:
proportion population Pennsylvania/Tennessee= 2.003
proportion symbols' area Pennsylvania/Tennessee= +/- 2.50
proportion population California/Florida= 2.005
proportion symbols' area California/Florida= +/-2.25
What we would like is that the proportion of the symbols' area is also equal
to 2.0.
We see the same in the legend:
proportion population 1.6e+07 / 4.0e+06 = 4.0
proportion symbols' area 1.6e+07 / 4.0e+06= +/-5.0
Thanks in advance!
Ann Frederix
Robbie Heremans
More information about the R-help
mailing list