I'm using ggplot to make bar graphs of data. I have everything ordered as I want it in my data frame but when I plot it, it is rearranged in some random order. How do I tell it to leave the bars in the order of the data frame? Thank you
iris Example below. In iris data frame species are ordered setosa, versicolor, virginica. They are ordered in reverse on the bar plot. It appears to be descending. This is not the case with my plots. Mine are in no obvious order.
ggplot(iris[iris$Sepal.Width ==3.0,]) + aes(x=Species, y=Sepal.Length) + geom_col() + coord_flip()
dput()
to share some of your data. – OTStatsiris
dataset, I"m not able to reproduce your error. Please provide more information about your dataset and your code. – dc37