I want to produce a boxplot for multiple groups y with continuous x. I give an example as follows:
library(ggplot2)
ggplot(diamonds, aes(carat, price)) +
geom_boxplot(aes(group = cut_width(carat, 0.25), colour=color))
However, the 'colour' does not work here . Could anybody help me to fix this problem? Thanks in advance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.