Skip to content
Prev 256969 / 398506 Next

Categorical bubble plot

On 04/15/2011 01:13 AM, Jurgens de Bruin wrote:
yes -- but you can make one up if you like.  e.g.


dd <- expand.grid(drugclass=LETTERS[1:5],
   plant=c("cactus","sequoia","mistletoe"))
set.seed(101)
dd$fitvalue <- runif(nrow(dd))

library(ggplot2)
ggplot(dd,aes(x=drugclass,y=plant,colour=fitvalue,size=fitvalue))+
  geom_point()

  By the way, I think you could represent your data much more
clearly this way: the "Cleveland hierarchy" says that it's easier
to assess quantitative values plotted along a common scale than via
size or colour ...

ggplot(dd,aes(x=drugclass,y=fitvalue,colour=plant))+
  geom_point()+geom_line(aes(group=plant))