Hi Stack Overflow Community! I am attempting to reorder the items in the attached legend to a specific order that I would like to input. The order is: Distal
, rTub
, Mid
, Prox
.
I have tried the order
function and scale_y_discrete()
. scale_y_discrete()
didn't work because the y axis is graphing a count frequency, and the data is stored as the text seen in the legend. The code I'm using to output the graph is below
p <- Scaphoid_dataF %>%
ggplot( aes(x=Age, fill = FxLoc, order = )) +
geom_histogram() +
labs(y = "Count of Fractures", x = "Patient Age", title = "Frequency of Fractures vs Age")
p + theme_bw() + scale_fill_grey()