I've created a heat map in ggplot and I'm using a default red to white scale_fill_gradient
. When I plot the gradient however, it appears to have an orange tint. I was wondering if there was a way to edit how ggplot
calculates the gradient so that I get pink intermediates so that it matches the other figures I'm making. Related to this graph, though I can post separately, I want to make my NA values have a striped pattern (rather than grey fill). I haven't found a way to do that in ggplot
.
p <- ggplot(heat.data, aes(x = MutResFac, y = mutAA, fill = disruption)) +
geom_tile(color="grey50") +
scale_fill_gradient(name = "Disruption", limits = c(0,3),
labels = c("WT-like", "Mild", "Moderate", "Severe"),
low = "#FFFFFF", high = "#FF0000",
guide = "legend") +
theme(axis.text.x = element_text(size = 25, hjust = 1),
text = element_text(size = 25),
plot.title = element_text(hjust = 0.5)) +
coord_fixed() +
labs(x = "Position", y = "Mutant Amino Acid") +
ggtitle(title) +
scale_x_discrete(labels = wildTypeSeqLabels)