Last active
December 14, 2015 03:19
-
-
Save JoesDataDiner/5019895 to your computer and use it in GitHub Desktop.
The Financial Crisis on Tape Part I - Graph - 1st attempt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(scales) | |
library(RColorBrewer) | |
#this is a slightly bespoke scale - basically I wanted a blue to red scale | |
#that gave extra variation over the interesting 0.6-1.0 range. | |
mycolvec_1 = c(rev(brewer.pal(8,"Blues")),rep("white",3),brewer.pal(8,"YlOrRd")) | |
ggplot(rolling.correlmatrix, aes(x = Var1, y = Var2, fill = Correl)) + | |
geom_tile() + | |
scale_fill_gradientn(colours = mycolvec_1 | |
,limits = c(-1,1))+ | |
facet_grid(quarter~year)+theme_bw()+ | |
theme(panel.grid.major.x = element_blank(), | |
panel.grid.major.y = element_blank(), | |
axis.title.x = element_blank(), | |
axis.title.y = element_blank(), | |
axis.text.x=element_text(angle=90)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment