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 8133639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:40:49+00:00 2026-06-06T09:40:49+00:00

If I have several plots in a single panel, I would like to be

  • 0

If I have several plots in a single panel, I would like to be able to put text annotations that go across more than one plot area or that go in between plot areas. I’m sure there must be a way to do this, but I need some help figuring out how.
Here’s some fake data to create four plots on one panel:

x1 = rnorm(100)
x2 = rnorm(100)
x3 = rnorm(100)
x4 = rnorm(100)

par(mfrow=c(2,2)) 
hist(x1, xlab="", main="Group A")
hist(x2, xlab="", main="Group B")
hist(x3, xlab="", main="")
hist(x4, xlab="", main="")

This creates the multi-plot panel below, except that I’ve also added text in red. I added the red text by annotating the PDF file after I created the graph panel in R and then saved it as a PDF. What I’d like to learn is how to annotate the graph panel programmatically within R, rather than having to save it and annotate the saved file.
Normally, I would just add an annotation using text() or mtext(). But that only works if you’re annotating a single graph. Is there a way to add annotations relative to the coordinates of the entire panel of 4 graphs? I’m looking for a solution in base graphics right now, but if anyone knows how to do something similar in ggplot2 or lattice, I’d be interested in seeing that as well.
enter image description here

  • 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-06T09:40:51+00:00Added an answer on June 6, 2026 at 9:40 am

    If you truly want finer control over these kinds of layout issues, you can use the aptly named layout.

    m <- matrix(c(1,2,3,3,4,5,6,6),ncol = 2,byrow = TRUE)
    layout(m,widths = c(0.5,0.5),heights = c(0.45,0.05,0.45,0.05))
    
    par(mar = c(2,4,4,2) + 0.1)
    hist(x1, xlab="", main="Group A")
    hist(x2, xlab="", main="Group B")
    
    par(mar = c(0,0,0,0)) 
    plot(1,1,type = "n",frame.plot = FALSE,axes = FALSE)
    u <- par("usr")
    text(1,u[4],labels = "Here",col = "red",pos = 1)
    
    par(mar = c(2,4,2,2) + 0.1)
    hist(x3, xlab="", main="")
    hist(x4, xlab="", main="")
    
    par(mar = c(0,0,0,0)) 
    plot(1,1,type = "n",frame.plot = FALSE,axes = FALSE)
    u <- par("usr")
    text(1,u[4],labels = "Here",col = "red",pos = 1)
    

    enter image description here

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

Sidebar

Related Questions

I have several file with the following format: lat,lon,value. I would like to plot
I have several different numbers in a group that range in sizes and would
I have several UITableViews and what I would like to do is to be
I would like to have several subplots in a row in a plot. However
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have several Delphi programs that maintain connections to a database (some Oracle, some
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
I would like to put an int into a string . This is what
Several times I have wanted to detect single keystrokes in R but have failed
I have the geo-coordinates (latidute & longitude) of some cities and would like to

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.