Program12

Author

Yash Pratap 1NT23IS252

Program 12

Develop a script in R to create a violin plot displaying the distribution of a continuous cariable with separate violins for each plot, using ggplot2.

library(ggplot2)
data <- iris
ggplot(data, aes(x = Species, y = Sepal.Length, fill = Species)) +
  geom_violin(trim = FALSE) +  
  labs(title = "Violin Plot of Sepal Length by Species",
       x = "Species",
       y = "Sepal Length") +
  theme_minimal() +
  theme(legend.position = "none")