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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:54:24+00:00 2026-06-02T02:54:24+00:00

Building on my previous question I’d like to add second axis label on the

  • 0

Building on my previous question I’d like to add second axis label on the opposite side of the plot.

The data frame looks like:

test <- structure(list(characteristic = structure(c(1L, 2L, 3L, 1L, 2L
), .Label = c("Factor1", "Factor2", "Factor3"), class = "factor"), 
    es = c(1.2, 1.4, 1.6, 1.3, 1.5), ci_low = c(1.1, 1.3, 1.5, 
    1.2, 1.4), ci_upp = c(1.3, 1.5, 1.7, 1.4, 1.6), label = structure(c(1L, 
    3L, 5L, 2L, 4L), .Label = c("1.2 (1.1, 1.3)", "1.3 (1.2, 1.4)", 
    "1.4 (1.3, 1.5)", "1.5 (1.4, 1.6)", "1.6 (1.5, 1.7)"), class = "factor"), 
    set = structure(c(1L, 1L, 1L, 2L, 2L), .Label = c("H", "S"
    ), class = "factor")), .Names = c("characteristic", "es", 
"ci_low", "ci_upp", "label", "set"), class = "data.frame", row.names = c(NA, 
-5L))

Using Tyler’s solution, a graph of it looks like that at the moment:

enter image description here

In a similar way to a forest plot I’d like to add a second set of labels (label variable in my data frame) representing graphed values, preferably on the right side of panels. So that it all mimics forest plot similar to this example:

enter image description here

I know that second axis seems to be frowned upon. However these are just another set of labels.. ant it seems to be a custom among forest plots.

How can I do that in ggplot?

  • 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-02T02:54:25+00:00Added an answer on June 2, 2026 at 2:54 am

    EDIT updating to ggplot2 0.9.3

    Adding your set of labels in your test dataframe to the faceted chart is straightforward. Use geom_text with aesthetics for the labels, and the x and y positions of the labels. In the code below, xlim creates a little more space for the labels. The following code:

    library(gridExtra)
    library(ggplot2)
    
    p <- ggplot(test, aes(y = characteristic, x = es, xmin = ci_low, xmax = ci_upp)) + 
      geom_point() +   
      geom_errorbarh(height = 0) +
      geom_text(aes(label = label, x = 2, y = characteristic)) + 
      scale_x_continuous(limits = c(1, 2.2), breaks = c(1, 1.2, 1.4, 1.6, 1.8),
        labels=c("1.0", "1.2", "1.4", "1.6", "1.8")) +
      facet_grid(set ~ ., scales = "free", space = "free") +
      theme_bw() + 
      theme(strip.text.y = element_text(angle = 0),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank())
    p
    
    grid.text(expression(paste("ES " %+-% " ci")), x = 0.78,   y = .92,
       gp = gpar(fontsize = 18))
    

    produces:

    enter image description here

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

Sidebar

Related Questions

After what I learned from my previous question , I would like to use
I'm working on building Cppcheck on AIX with the xlC compiler (see previous question
Is my second question on this topic today but on the previous one it
As a follow up to this previous question , I have a Core Data-based
Objective c | xcode | iphone question Im building a model(data) class for a
Building on from a previous query regarding Class::Struct vs Object::Accessor, I'd like to find
I'm building a ASP.net quiz engine and I'm using a previous quiz engine i
Building a client-side swing application what should be notified on a bus (application-wide message
Building on what has been written in SO question Best Singleton Implementation In Java
This IS NOT a Homework question! While building my current student database project I

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.