I know this question has been asked/answered in a few different incarnations -- I'm failing to see the solution to the flavor of my problem.
I'd like all the "methods" in the plot below to be plotted in descending order as a function of the mean AAC (that is the value plotted in geom_point()
). Each of these points is grouped by "Period" -- there are two periods -- historic, and future.
current code:
df_level3_MW %>%
mutate(Period=fct_relevel(Period,"historic","future")) %>%
ggplot(aes(x = reorder(Period,-mean_AAC),
y = mean_AAC,
group = interaction(factor(Tech),factor(TypeID),method)))+
geom_point(size = 1.8,
alpha = .8,
position = position_dodge(0.9),
aes(color = factor(method),
shape = factor(TypeID)))+
geom_errorbar(aes(ymin=min_AAC,
ymax=max_AAC,
color = factor(method),
linetype = factor(Tech)),
position=position_dodge(0.9),
size = 0.3,
width=0.5)+
labs(title = "Distribution of AAC across all gcms, methods",
colour="method",
shape="TypeID",
linetype="Tech")+
ylab("Region-Weighted AAC")+
scale_color_manual(values=plasma_pal)+
scale_linetype_manual(values=c("solid","11","22"))