This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting Data With Multiple Axes

Hello, I have a couple of co-expressed gene clusters corresponding to each developmental stage of a plant, (total 3 such stages). I want to plot the distribution of genes in the modules for each of the stages, in a compact form since I have to put them in a poster. Pie charts are taking too much space.

Kindly suggest a resource where I can do this sort of a thing: Plots with Multiple axes

Example of my data:

Clusters x-stage y-stage    z-stage
black         91         190    127
green        163         564    258
turquoise    318         420    149
red          200         381     295
graphs

First of all, you can show us how your data looks like.
My answer probably would be ggplot.

You can (should) also try BoxPlotR (a web-tool for generation of box plots).

1 answer

I think that you can achieve the goal by using ggplot in order to make individual plots and then combine those with grid & gridExtra packages as it is shown here. Yet another option would be to use facet-grid of ggplot. If you update your post with few examples of the data and figures that you have, I am sure that you'll be able to get more help here.

Here is an easy way of visualization of your data using facets and barplots, i.e. geom_hist:

require(ggplot2)
require(gridExtra)
require(reshape)

dat=read.table(header=T, text="Clusters x-stage y-stage    z-stage
black         91         190    127
green        163         564    258
turquoise    318         420    149
red          200         381     295")

dm=melt(dat,id.var=c("Clusters"))

p1 <- ggplot(dm, aes(variable, value, fill=variable)) + theme_bw() +
  geom_histogram(stat="identity") + facet_grid(. ~ Clusters)

p2 <- ggplot(dm, aes(Clusters, value, fill=Clusters)) +
  geom_histogram(stat="identity") + facet_grid(. ~ variable)

print(arrangeGrob(p1, p2, ncol=1))

enter image description here

You can adjust theme and use other visualizations (geom_boxplot, stat_ydensity) with different data.

Log in to answer this question.