Hello,
I'm enjoying easy creation of choropleth plots with ggplot 0.8.9 on R2.13. In particular, I'm making use of the diverge color map, drawing from Hadley's examples. I really like the red-to-blue one, but I can't seem to figure out how to flip high and low with it (like I can without a diverge gradient). In the following plot, I'd like the red end to be blue (eg California), and the blue end to be red.
Here's my code:
choropleth.st (value, name="Avg Chamber Polarization", main = "State Legislative Polarization 2006", filename = "geography_avg_polarization", diverge=T)
Use
scale_fill_gradient2 with the low, mid, and high and define the midpoint explicitly
or
scale_fill_gradientn with a diverging sequence of colours, if you don't want to pick the midpoint explicitly. colours are used in the order in which they are specified. In you example, we don't know where the pal() function comes from. You can use rev(pal(7)) to reverse the vector of colours or use something like c("red","white","blue") as the colours argument
Jean-Olivier Irisson
---
Observatoire Océanologique
Station Zoologique, B.P. 28, Chemin du Lazaret
06230 Villefranche-sur-Mer
Tel: +33 04 93 76 38 04
Mob: +33 06 21 05 19 90
http://jo.irisson.com/