Plotting Data With Multiple Axes
1
0
Entering edit mode
10.2 years ago
pixie@bioinfo ★ 1.5k

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 • 3.1k views
ADD COMMENT
0
Entering edit mode

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).

ADD REPLY
0
Entering edit mode
10.2 years ago
Pavel Senin ★ 1.9k

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.

ADD COMMENT

Login before adding your answer.

Traffic: 1411 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6