3
I want to create a histogram in ggplot but the y-axis values are getting out of order. I want to place them in ascending order on the axis. I tried to use the "reorder" function but it didn’t work.
dados(hrlinear)
ID Home range (m)
#MB02 156.148
#MB03 247.969
#MB04 156.148
#MB05 92.400
#MB06 1022.954
#MB07 156.148
#MB08 672.731
#MB09 156.148
#MB10 594.328
#MB11 554.670
#MB12 672.731
#MB13 474.969
#MB14 0.000
#MB15 0.000
#MB16 156.506
I’m using the following path:
ggplot(hrlinear,
aes(x=ID, y = reorder(Home.range..m., -ID)))+
geom_bar(stat="identity") +
labs(x = "ID dos Tags", y = "Home range linear (m)")
Hello Francielle, the ideal is you put one
dput()
of your data.– Alexandre Sanches