Question: Equal distance between groups in a barplot
0
gravatar for c.chakraborty
10 months ago by
c.chakraborty130
c.chakraborty130 wrote:

I have a very simple question and I have been quite unable to find a suitable answer. I am making barplots for GO-enriched terms-

barplot(Fold.Enrichment,
        names.arg = Description,
        horiz = TRUE,
        cex.names = 0.5,
        cex.axis = 0.6,
        col = "blue",
        xlim = c(0, 3))

When I get the plot, not all the bars are equidistantly separated from each other. It looks clumsy. Is there a way by which, I can specify a distance between bars?

R • 326 views
ADD COMMENTlink modified 10 months ago by zx87547.3k • written 10 months ago by c.chakraborty130
2
gravatar for firatuyulur
10 months ago by
firatuyulur280
firatuyulur280 wrote:

I just read now that there is a parameter called "space" in barplot function. for each bar, you type the distance from the next bar.

ADD COMMENTlink written 10 months ago by firatuyulur280
1
gravatar for c.chakraborty
10 months ago by
c.chakraborty130
c.chakraborty130 wrote:

Problem solved:

barplot(david_go__ord_foldenr$Fold.Enrichment,
        names.arg = david_go__ord_foldenr$Description,
        horiz = TRUE,
        space = 0.1,
        cex.names = 0.5,
        cex.axis = 0.6,
        col = "blue",
        xlim = c(0,3))
ADD COMMENTlink modified 10 months ago by zx87547.3k • written 10 months ago by c.chakraborty130
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 830 users visited in the last hour