Why does this ggridges plot implies negative values when there are none?

28 Views Asked by At
library(ggplot2)
library(tidyverse)
library(ggridges)

data(iris)
ggplot(iris, aes(Petal.Width, Species))+ 
  ggridges::geom_density_ridges()+
  coord_cartesian(xlim=c(0, 4))+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
        panel.background = element_blank(), axis.line = element_line(colour = "black"))

enter image description here

This ggridges visualization implies that some petal widths for setosa and the others are below zero, but this shouldn't be possible since there are no negative values in the dataset. I am wondering why the visualization shows negative values being in the data at some frequency?

0

There are 0 best solutions below