Monday, April 20, 2015

Some examples of directlabels with ggplot2

p<- ggplot(test4, aes(x=test4$FC, y=test4$PVALUE)) + geom_point(shape=19, alpha=1/8, color="red", size=8)
+ geom_dl(aes(label=test3, colour=test4$CATEGORY), list("smart.grid", cex = 1.5, hjust = 1)) 
+ scale_colour_discrete(name="CATEGORIES")
+ scale_x_continuous(limits = c(-5, 25))
+ xlab("Fold change")
+ ylab("-log P-value")
+ ggtitle("Title of the graph")



p<- ggplot(test4, aes(x=test4$FC, y=test4$PVALUE)) 
+ geom_point(shape=19, alpha=1/8, color="red", size=8)
+ geom_dl(aes(label=test3, colour=test4$CATEGORY), list("first.bumpup", cex = 1.5, hjust = 1))
+ scale_colour_discrete(name="CATEGORIES")
+ scale_x_continuous(limits = c(-5, 25))
+ xlab("Fold change")
+ ylab("-log P-value")
+ ggtitle("Title of the graph")






p<- ggplot(test4, aes(x=test4$FC, y=test4$PVALUE)) 
+ geom_point(shape=19, alpha=1/8, color="red", size=8)
+ geom_dl(aes(label=test3, colour=test4$CATEGORY), list("last.bumpup", cex = 1.5, hjust = 1)) 
+ scale_colour_discrete(name="CATEGORIES")
+ scale_x_continuous(limits = c(-5, 25))
+ xlab("Fold change")
+ ylab("-log P-value")
+ ggtitle("Title of the graph")






 p<- ggplot(test4, aes(x=test4$FC, y=test4$PVALUE)) 
+ geom_point(shape=19, alpha=1/8, color="red", size=8)
+ geom_dl(aes(label=test3, colour=test4$CATEGORY), list("top.bumptwice", cex = 1.5, hjust = 1)) 
+ scale_colour_discrete(name="CATEGORIES")
+ scale_x_continuous(limits = c(-5, 25))
+ xlab("Fold change")
+ ylab("-log P-value")
+ ggtitle("Title of the graph") 






No comments:

Post a Comment