There is no easy way to do this directly in ggplot, since you need to reorder CLONE 3, TREAT, YEAR and VALUE, otherwise forcats::fct_reorder2 could be an option. Instead, extract the CLONE order from the subset of data corresponding to YEAR = "X", TREAT = "C" and redefine the factor levels for the entire data set based on that subset.
library("ggplot2") library("dplyr") set.seed(36) xx <- data.frame(YEAR = rep(c("X","Y"), each = 20), CLONE = rep(c("A","B","C","D","E"), each = 4, 2), TREAT = rep(c("T1","T2","T3","C"), 10), VALUE = sample(c(1:10), 40, replace = TRUE), stringsAsFactors = FALSE) clone_order <- xx %>% subset(TREAT == "C" & YEAR == "X") %>% arrange(-VALUE) %>% select(CLONE) %>% unlist() xx <- xx %>% mutate(CLONE = factor(CLONE, levels = clone_order)) ggplot(xx, aes(x = CLONE, y = VALUE, fill = YEAR)) + geom_bar(stat = "identity", position = "dodge") + facet_wrap(~TREAT)
gives

source share