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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:42:38+00:00 2026-06-01T12:42:38+00:00

I would like to make a plot with ggplot that looks very close to

  • 0

I would like to make a plot with ggplot that looks very close to this (found here):

enter image description here

However, instead of frequency I would like to plot ranges for conditions. Here is a sketch of the plot I want to produce with 5 conditions:

enter image description here

My data is arranged as a start and end coordinate for the range. For example, for condition 5 the start of the range is 30 and the end of the range is 40 (I’ve labeled this about the graph for clarity). My data is from a file in the form:

id      start   end
1       20      35
2       60      75    
3       10      30
4       80      90
5       30      40

I have about 100 start and end values that I would like to plot in this manner on one graph. The final plot should be only two colors.

UPDATE:

For future reference, Justin’s solution produces this:

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-01T12:42:39+00:00Added an answer on June 1, 2026 at 12:42 pm

    Something like this:

    library(ggplot2)
    library(reshape)
    dat <- data.frame(lets=letters[1:5], low=1:5, mid=3:7, high=10:14)
    dat.melt <- melt(dat, id.vars='lets')
    
    
    ggplot(dat.melt, aes(x=lets, y=value, fill=variable)) + 
      geom_bar(stat='identity') + 
      scale_fill_manual(breaks=c('low','mid','high'), values=c('blue','red','blue')) +
      coord_flip()
    

    But fairly dependent on your data…

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

Sidebar

Related Questions

I would like to make California's map by the contour plot. However, I do
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to make a nightly cron job that fetches my stackoverflow page
I would like to make a child class that has a method of the
I would like to make a matplotlib plot having only the left and bottom
I would like to make a log-probability plot for my data. I looked up
I want to make a radial stacked barchart. I have something like this: ggplot(diamonds,
I would like to make an interaction plot to visually display the difference or
I would like to make a script that outputs only the real time value
I would like to plot discrete values in MATLAB like this: stairs() and stem()

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.