0
votes

My goal is, to plot how often some bands have played at a festival. Basically, the plot should look like this:

ggplot(plot.df2, aes(reorder(bands,count),count)) + geom_point() + coord_flip()+ theme_bw()

enter image description here

But i would like to have a point for every time, the band has played there. This would be a "staple of points" like this one:

ggplot(plot.df2, aes(count)) + geom_dotplot()+ coord_flip()+theme_bw()

enter image description here

Is this possible in ggplot2?

Here is some example-data:

bands<-c("Queens of the Stone Age","The Sounds","Beatsteaks","Billy Talent","Donots","The Hives","Tocotronic")
count<-c(6,6,5,5,5,5,5)
plot.df<-as.data.frame(cbind(bands,count))
1

1 Answers

1
votes

You could do this, but it requires a bit of manual tuning of the scale to look decent.

plot.df <- data.frame(band = rep(bands, count),
                      count = unlist(lapply(count, seq_len)))
ggplot(plot.df, aes(x = count, y=band)) +
    geom_point() + scale_x_continuous(limits=c(0, 10), breaks=seq(0, 10, by=2)

enter image description here