Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change shape of dotplot?

Tags:

r

ggplot2

I have a data file with this basic structure:

Type Tm
A 1
A 2
A 3
B 3
B 3
C 1
C 1
C 2

I'm making a dotplot out of it using:

ggplot(data=df,aes(x = Tm,fill=Type)) +
geom_dotplot(binwidth=1,method="histodot",stackgroups=TRUE)

It works fine. However, I wondered if it's possible to change the shapes of the dots from the default circles. For example to make A triangles, B squares and leave C the default circles. I tried various combinations of scale_shape but no success. Sometimes I get various error messages and sometimes nothing happens. This leads me to the conclusion that either I'm doing something wrong, or that it's not even possible. Which one is it?

edit

The comment by joran from Feb 2013 says that it hasn't been implemented yet. Were there any developments in this field in the past year and a half?

like image 816
Gimelist Avatar asked Feb 26 '13 21:02

Gimelist


1 Answers

Unfortunately, there is NO option for this, and it doesn't sound like there are any plans to make an option.

I'm frankly shocked.

https://github.com/tidyverse/ggplot2/issues/1111

Perhaps Plotly has an option.

like image 55
abalter Avatar answered Oct 14 '22 00:10

abalter