I am trying to create a geom_ribbon chart, but the plot only shows the axes, without the plots.
The codes I wrote:
install.packages("tidyverse")
library("tidyverse")
data("diamonds")
ggplot() +
geom_ribbon(data=diamonds,
mapping = aes(
y=carat,x=cut,
ymin = min(carat),
ymax = max(carat)
), fill = "blue"
)
The result I got:
I would like to know where went wrong. Thanks.
I tried to get help from https://mpn.metworx.com/packages/ggplot2/3.3.0/reference/geom_ribbon.html but could not relate the examples to my own problem.