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

  • Home
  • SEARCH
  • 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 8974253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:38:25+00:00 2026-06-15T18:38:25+00:00

I am using grid.arrange from gridExtra package to put two graphs on one page

  • 0

I am using grid.arrange from gridExtra package to put two graphs on one page and save it to a png file. I like to change the background colour of the final png file that is produced by grid.arrange. Is it possible? I was not able to come across any info.

grid.arrange(p1, p2, main=textGrob("CPU Util", gp=gpar(cex=1.2, fontface="bold", col="#990000")), ncol = 1, clip=TRUE)
  • 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-15T18:38:26+00:00Added an answer on June 15, 2026 at 6:38 pm

    Try setting the bg = argument to png()

    library(gridExtra)
    library(lattice)
    
    png(bg = "wheat1")
        grid.arrange(xyplot(1:10~1:10, pch=16), xyplot(1:4~1:4, pch=16))
    dev.off()
    

    enter image description here

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

Sidebar

Related Questions

When I am writing a file into GridFS using grid.put(), which has the same
I'm using Grid view in my asp.net page and I'm fetching data from SQL
I am trying to use grid.arrange to display multiple graphs on the same page
I'd like for my column header to also be footers using MVCContrib grid. How
I have a short routine which arranges ggplot and grid graphics using the grid.arrange
I am using grid view with ImageAdapter to display images. I have two set
I using one header control in wpf application in that I am using Grid
I'm using grid that looks like that: Html.Telerik().Grid(Model).Name(preciousGrid). ... bla bla bla.. .ClientEvents(events =>
I'm using ggplot and have two graphs that I want to display on top
I'd like to arrange a 3x3 grid layout over 3 pages of a PDF

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.