Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:13:27+00:00 2026-06-12T12:13:27+00:00

I found some solutions but not exactly what I want. I have 5 dataframes

  • 0

I found some solutions but not exactly what I want. I have 5 dataframes in R and each dataframe has 4 columns:

Lets say name of the first dataframe is “Gene1”

Ind1     Ind2       Ind3      Ind4
1          3         3.2        2.5
1          3         4          2
1.5        2         2.2        1
3.4        2         1          3

and remaining dataframes are called “Gene2”, “Gene3″,”Gene4″,”Gene5” and are similar.

I want to plot boxplots side by side in same plot for all dataframes and for all columns. I did not find any plot like this, so I can’t upload a picture but I will try to explain.

Now from above data, the plot will have 20 box plots. First 4 box plot should be close to each other and x-axis name should be “Gene1” (for all 4 box plots) and then a little space in plot and again 4 box plots with x-axis name “Gene2” and so on.

I can easily plot all the box plots in one plot but I am not able to distinguish dataframes. Meaning, it should clearly show us that first 4 box plots are from “Gene1” and next 4 box plots are from “Gene2” and so on.

Please let me know if the problem is not clear.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:13:28+00:00Added an answer on June 12, 2026 at 12:13 pm

    I suspect this is what you want, and it is in fact not very complicated to do with the plotting functions in the standard graphics package. The groups are plotted as 4 separate panels, but with a shared y-axis and title plotted in the outer margin it looks like a single plot.

    # Faking the data, since you didn't provide any
    Gene <- data.frame(matrix(rweibull(100*4, 1), 100))
    names(Gene) <- paste0("Ind", 1:4)
    Gene <- rep(list(Gene), 4)
    
    # Setup the panels
    layout(t(1:4))
    par(oma=c(2, 4, 4, 0), mar=rep(1, 4), cex=1)
    # `mar` controls the space around each boxplot group
    
    # Calculating the range so that the panels are comparable
    my.ylim <- c(min(sapply(Gene, min)), max(sapply(Gene, max)))
    
    # Plot all the boxes
    for(i in 1:length(Gene)){
        boxplot(Gene[[i]], ylim=my.ylim, axes=FALSE)
        mtext(paste("Gene", i), 1, 0)
        if(i == 1){
            axis(2, las=1)
            mtext("Expression or what you have", 2, 3)
        }
    }
    title("Look at all my genes!", outer=TRUE)
    

    enter image description here

    By the way, I recommend storing your data frames in a list rather than mimicing a list by naming them “Gene1”, “Gene2”, “Gene3” and “Gene4”. It is a lot easier to automate that way. If you still want to store them as separate variables, replace Gene[[i]] with get(paste0("Gene", i)) and my.ylim <- ... with min(c(min(Gene1), min(Gene2) ... etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found some similar Que's on SO but had not find the solution.
Hi i have been looking for some solutions but i have found nothing... Is
I found some questions that looked similar, but not exactly the same so I'll
I've found some questions here about this topic, but none of the solutions solve
Although I have found some solutions to this problem, none of them refer to
I've searched the Internet and have found some good solutions for teeing STDOUT to
I found some things I want to submit a pull request for in the
I found some classes designed for debugging in package com.sun.jdi like VirtualMachine , but
Firstly, apologies for the vague title, but I'm not sure exactly what I'm asking
I have been working on a project in scala, but I am getting some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.