lionel- / ggstance

Horizontal ggplot2 components
201 stars 20 forks source link

legend title NA induced by geom_boxploth #9

Closed Pierre-Andre closed 7 years ago

Pierre-Andre commented 7 years ago

data(diamonds) geom_boxploth(data=diamonds,aes(y=-0.5,x=carat,fill=cut))+ geom_density(aes(x=carat,y=..density..)) + facet_grid(cut~.)

does the job BUT (the order is reversed)

ggplot(data=diamonds) + geom_density(aes(x=carat,y=..density..)) + geom_boxploth(data=diamonds,aes(y=-0.5,x=carat,fill=cut))+ facet_grid(cut~.)

produces a legend title "NA"


packageVersion("ggplot2") [1] ‘2.1.0’ packageVersion("ggstance") [1] ‘0.2.9000’ R.version.string [1] "R version 3.3.1 (2016-06-21)"

lionel- commented 7 years ago

It looks like this is an upstream issue:

ggplot(diamonds) +
  geom_density(aes(x = carat, y = ..density..)) +
  geom_boxplot(aes(x = -0.5, y = carat, fill = cut)) +
  facet_grid(. ~ cut)

Could you file there please?