Friday, November 5, 2010

ggplot2

http://learnr.wordpress.com/2009/08/20/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-13-2/

> library("flowViz")
> data(GvHD, package = "flowCore")
> pl <- densityplot(Visit ~ `FSC-H` | Patient, data = GvHD)
> print(pl) 
# Pie charts words grouped by journals
fig3a <- ggplot(melted, aes(x = factor(1), fill=variable)) +  # x and y
            geom_bar(width=1) +                              # layers
            coord_polar(theta = "y") +                       # pie chart
            facet_wrap(~journal, nrow = 1) +                # group
            scale_fill_manual(values = myColors) +           # some matching colors
            opts(axis.text.x = theme_blank(),               # remove x-label
                axis.title.x=theme_blank(),
                title = 'Journal word frequencies') +    
            opts(legend.position="right")                   # legend to the bottom
grid.arrange(fig3a, fig3b, nrow = 2, ncol = 1)

No comments: