Last active
August 29, 2015 14:06
-
-
Save alexhanna/bc2de9caf51415d69149 to your computer and use it in GitHub Desktop.
This file contains 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
p <- ggplot(df.p, aes(x=Margin, y=factor(variable), fill = Class, alpha = value)) | |
p <- p + theme_bw() + geom_tile(color = NA, width = 0.005) + scale_fill_manual(values = wes.palette(2, "Royal1"), labels = c("False Positives", "True Positives")) | |
p <- p + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) | |
p <- p + theme(axis.text.y = element_text(size = 7)) + ylab("Feature") | |
ggsave(p, file = "../img/linearsvc_no-fs_top100_fp-v-tp_20140916.png", width = 16, height = 9) |
Hmm -- looks like some people are passing in some "alpha" command -- http://stackoverflow.com/questions/10232525/geom-tile-heatmap-with-different-high-fill-colours-based-on-factor
Also being explicit about fills using scale_fill_manual might be necessary. This will require library(scales) I believe.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you have to pass color and fill in to geom_tile as well
something like geom_tile(aes(color = Class, fill = value))