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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:15:58+00:00 2026-06-09T20:15:58+00:00

is it possible to use geom_ribbon from the package ggplot2, but with the range

  • 0

is it possible to use geom_ribbon from the package ggplot2, but with the range plotted horizontally and not vertically. This would be trivial if “geom_ribbon” proposed the options xmin/xmax, but this is not the case.

Here is my data, a simplified plotting function for testing and the figure I obtain. So in this example, I would like to have the “depth” axis displayed vertically.

prof <- read.table(text = " depth prop mean error
1 5 FALSE 2.12 0.035
2 15 FALSE 2.06 0.035
3 25 FALSE 1.54 0.035
4 35 FALSE 0.92 0.033
5 45 FALSE 0.71 0.028
6 55 FALSE 0.60 0.026
7 65 FALSE 0.54 0.024
8 75 FALSE 0.49 0.023
9 85 FALSE 0.46 0.022
10 95 FALSE 0.43 0.022
11 105 FALSE 0.41 0.022
12 115 FALSE 0.39 0.021
13 5 TRUE 2.18 0.061
14 15 TRUE 2.11 0.061
15 25 TRUE 1.58 0.054
16 35 TRUE 0.97 0.047
17 45 TRUE 0.76 0.042
18 55 TRUE 0.67 0.043
19 65 TRUE 0.61 0.040
20 75 TRUE 0.54 0.033
21 85 TRUE 0.48 0.028
22 95 TRUE 0.45 0.027
23 105 TRUE 0.43 0.025
24 115 TRUE 0.40 0.022", header=TRUE)

ggplot(prof, aes(colour = prop, fill = prop)) + 
  geom_ribbon(aes(x = depth, ymin = mean-error, ymax = mean+error), 
  alpha = 0.6, colour = NA)

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-09T20:15:59+00:00Added an answer on June 9, 2026 at 8:15 pm

    Have look at coord_flip() This is untested since you didn’t provide the data in an easy format. Post the output of dput(your.data.frame) to provide data.

    ggplot(prof, aes(x = depth, ymin = mean - error, ymax = mean + error, 
        fill = prop)) + geom_ribbon() + coord_flip()
    

    andpleaseusethelargebaratthebottomofyourkeyboardwhentypingcodewhitespacemakestextmuchmorereadablecodeisalsotext

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

Sidebar

Related Questions

The following code use to work pre-version .9 of ggplot2. Is this not possible
what could be a possible use of declaring types within a namespace but not
Is it possible use a MySQL query to perform this kind of check? If
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
The original use case: This is a possible use case I'm trying to solve:
is it possible use Jenkins to create an EAR file for manual deployment? This
Possible Duplicate: Use of 'prototype' vs. 'this' in Javascript? I went to various websites
Is it possible use in-explicit constructing with operators ? Just like in this example
I'm not sure if this is on-topic or not here, but it's so specific
Is it possible use RESTKit with ASIHTTPRequest? I have been using ASIHTTPRequest but it

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.