Here is the code to create a heatmap in MATLAB that shows the dominance of Democrats or Republicans in an election along with the percentage of votes they received in each cell:
main.m927 chars31 lines
This will create a heatmap that shows the dominance of Democrats in the election, with cells shaded according to the percentage of votes received. Republican dominance is also shown with a translucent overlay. The democrat_votes
and republican_votes
arrays can be replaced with your own data.
gistlibby LogSnag