What are the ways of imposing one histogram on another besides the gglot and the parameter add = T in R?
1 answer
In the comments to the question rightly ask - "why?".
If there is a task to compare the distribution of a variable across some groups, it is better to use geom_density
library(viridis) library(ggplot2) gg_dens <- ggplot(airquality)+ geom_density(aes(x = Temp, color = factor(Month)))+ scale_color_viridis(option = "B", discrete = T, end = .8)+ theme_minimal()+ theme(legend.position = c(.8,.8)) In my opinion, it is even more convenient to visually compare the accumulated distributions - empirical cumulative density ( stat_ecdf ).
gg_ecdf <- ggplot(airquality)+ stat_ecdf(aes(x = Temp, color = factor(Month)))+ scale_color_viridis(option = "B", discrete = T, end = .8)+ theme_minimal()+ theme(legend.position = c(.1,.8)) - There about "besides ggplot2" it is asked, from here bewilderment. - Ogurtsov
- Really. Then it is even more doubtful what is needed at all - ikashnitsky
|


lattice,plotly,rbokeh,ggvis. The key question is why? - Ogurtsov