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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:32:02+00:00 2026-06-18T02:32:02+00:00

![Y Axis: Frequency, X axis: Ratio][1] https://i.stack.imgur.com/Xmg3i.png Can anyone help me with a suitable

  • 0

![Y Axis: Frequency, X axis: Ratio][1]

https://i.stack.imgur.com/Xmg3i.png

Can anyone help me with a suitable syntax to create this kind of a histogram in R? The input data will be the Ratio corresponding to a person and his/her age range. Sample:

Age Ratio
(15-19) 0.97
(65-69) 1.2084
(50-64) 1.3049

and so on.

I’m not sure what these are called, could you mention the name of this kind of histogram as well?

  • 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-18T02:32:03+00:00Added an answer on June 18, 2026 at 2:32 am

    I think you might have the best luck with the ‘ggplot2’ package, and the chart you’re looking for is a “stacked bar chart” and not a histogram.

    Setup: Create some sample data.

    data <- data.frame(age=sample(c("15-19", "20-24", "25-29","30-34"),100,rep=TRUE), ratio=rnorm(100,mean=1,sd=0.3))
    

    Plot it: We can just use the ‘qplot’ function here.

    library(ggplot2)
    qplot(ratio, data=data, geom="bar", fill=age, binwidth=0.1)
    

    Here, we tell the ‘qplot’ function to use the [ratio] data from our [data] data frame and to plot it in a bar chart geometry. The data should be split and colored by the [age] (fill=age), and each bar should be 0.1 wide. You should be able to adjust this to your needs.

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

Sidebar

Related Questions

How can one image be rotated with axis of rotation as image centre using
Hi I have axis in webapp and I can access http://localhost:8080/oop/services/test2?wsdl correctly. I wrote
If my X axis is time, and my Y is numeric data, how can
How can the axis be set depending it's draggable direction (after init)? If it's
UPDATE 2016-03-15 Please take a look at this project: https://github.com/ooper-shlab/aurioTouch2.0-Swift . It has been
How can I change the data on one axis? I'm making some spectrum analysis
How can I centre the labels on the x-axis to match up with the
I am trying to create bar graphs of letter frequency in Python. I thought
Maven puts both axis-1.3.jar and axis-1.4.jar to WEB-INF/lib of my war. Can someone explain
I can add 2 y-axis to a octave/matlab plot but when I try and

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.