1

how to order the Heatmap by the names of the Candidates on the y axis ?

This is my current code which does an opposite order comparing to what I want (and I want an order from A to Z by the name):

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:

enter image description here

4

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.