0

I there,

I would like to use the viridis color scale, but it doesn't work.. And I would like to obtain just one legend with color and alpha scale in one, so one legend with color and trasparency together for every boxplot...

install.packages("viridis")
library(viridis)
b<-ggplot(boxp, aes(x = boxp$causa, y = boxp$los, fill = boxp$causa, 
alpha=boxp$tdm)) + geom_boxplot() + stat_boxplot(geom='errorbar')+scale_color_viridis(discrete=TRUE)+ theme_bw()

b + labs(x="Parametri", y="los", fill="Parametri")

Here's what I obtain..really a poor graph..(for the Isolati observations seems that alpha is not working..)enter image description here

How can I get a better one? Thank you

ArTu
  • 431
  • 4
  • 20
  • 2
    You are using `aes(fill=)` but are setting `scale_color_viridis`, do you mean `scale_fill_viridis`? When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jun 25 '18 at 15:16
  • 1
    Avoid using `$` in the aes call. – tjebo Jun 25 '18 at 22:24

0 Answers0