0

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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.