I’m creating a dot plot using ggplot2 in R to visualize the distribution of Sepal.Length in the iris dataset. However, the y-axis shows values from 0 to 1 as if it’s a density plot, when I need it to show actual frequency counts. Additionally, I noticed that the upper part of the plot gets trimmed when resizing, as shown in the image below. How can I fix these issues?
Here’s the code I’m using:
library(ggplot2)
ggplot(iris, aes(Sepal.Length)) + geom_dotplot(method = 'histodot')