如何按y轴上的候选人姓名订购热图?
这是我当前的代码,与我想要的相比,它的顺序相反(我希望通过名称从A到Z的顺序):
ggplot(data = primary_results, aes(y = candidate, x = state_abbreviation)) +
geom_tile(aes(fill = fraction_votes)) +
scale_fill_viridis(option = "plasma") +
theme_solarized_2() +
xlab("State") +
ylab("Candidate") +
guides(fill = guide_legend(title="Fraction Votes"))
MyCurrentHeatmap: