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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:12:20+00:00 2026-06-10T23:12:20+00:00

I want to make bar charts where the bar minimum can be specified (much

  • 0

I want to make bar charts where the bar minimum can be specified (much like the box in a box and whisker plot). Can barplot do that? I suspect the answer’s in ggplot, but I can’t find an example.
Here’s some data:

                    X  Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
1      Highest recorded 31.5 31.8 30.3 28.0 24.9 24.4 21.7 20.9 24.5 25.4 26.0 28.7
2  Mean monthly maximum 27.8 28.6 27.0 24.8 22.0 20.0 18.9 18.8 20.4 22.4 23.9 26.8
3    Mean daily maximum 24.2 24.8 23.1 20.9 18.4 16.3 15.5 15.7 16.9 18.3 20.0 22.4
4                  Mean 19.1 19.8 18.1 16.2 13.8 11.9 11.2 11.6 12.7 14.1 15.7 17.7
5    Mean daily minimum 14.0 14.7 13.1 11.4  9.2  7.5  6.9  7.4  8.4 10.0 11.4 13.0
6  Mean monthly minimum  7.6  9.1  6.8  3.8  2.3 -0.5 -0.2  1.0  2.3  3.7  5.3  6.7
7       Lowest recorded  4.0  5.6  4.1 -1.3  0.0 -3.1 -2.6 -1.4 -0.8  2.0  2.7  4.1

xaxis =c(“J” ,”F” ,”M” ,”A” ,”M” ,”J”,”J”,”A”, “S”, “O”,”N”,”D”)

So ideally, I end up with a stacked bar for each month, that starts at the ‘Lowest recorded’ value, rather than at zero.

I’ve also had a try with superbarplot from the UsingR package. I can get the bars to start where I want, but can’t move the x axis down out of the centre of the plot. Thanks in advance.

  • 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-10T23:12:22+00:00Added an answer on June 10, 2026 at 11:12 pm

    You can use geom_boxplot in ggplot2 to get what (I think) you want specifying the precomputed values and stat = 'identity' and use geom_crossbar to put in the other

    # first, your data
    weather <- read.table(text = 'X  Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
    1      "Highest recorded" 31.5 31.8 30.3 28.0 24.9 24.4 21.7 20.9 24.5 25.4 26.0 28.7
    2  "Mean monthly maximum" 27.8 28.6 27.0 24.8 22.0 20.0 18.9 18.8 20.4 22.4 23.9 26.8
    3    "Mean daily maximum" 24.2 24.8 23.1 20.9 18.4 16.3 15.5 15.7 16.9 18.3 20.0 22.4
    4                  "Mean" 19.1 19.8 18.1 16.2 13.8 11.9 11.2 11.6 12.7 14.1 15.7 17.7
    5   "Mean daily minimum" 14.0 14.7 13.1 11.4  9.2  7.5  6.9  7.4  8.4 10.0 11.4 13.0
    6  "Mean monthly minimum"  7.6  9.1  6.8  3.8  2.3 -0.5 -0.2  1.0  2.3  3.7  5.3  6.7
    7       "Lowest recorded"  4.0  5.6  4.1 -1.3  0.0 -3.1 -2.6 -1.4 -0.8  2.0  2.7  4.1', header =T)
    
    
    library(reshape2)
    library(ggplot2)
    # reshape to wide format (basically transposing the data.frame)
    w <- dcast(melt(weather), variable~X)
    ggplot(w, aes(x=variable,ymin = `Lowest recorded`, 
             ymax = `Highest recorded`, lower = `Lowest recorded`, 
             upper = `Highest recorded`, middle = `Mean daily maximum`)) + 
         geom_boxplot(stat = 'identity') +
         xlab('month') + 
         ylab('Temperature') +
         geom_crossbar(aes(y = `Mean monthly maximum` ))+
         geom_crossbar(aes(y = `Mean monthly minimum`)) +
         geom_crossbar(aes(y = `Mean daily maximum` ))+
         geom_crossbar(aes(y = `Mean daily minimum`)) 
    

    enter image description here

    This is partially described in an example in the help for geom_boxplot

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

Sidebar

Related Questions

I want to make a rating bar that can work and display properly at
I want to make a bar plot where one of the values is much
I'd like to make a login bar for an application and I can't figure
I want to make bar chart using jfreechart such that the bars which belong
I want to make a progress bar for my terminal application that would work
I want to make the following stacked bar plot together with line curve. But
I want to make a DataGridViewProgressBar that uses the native progress bar rendering. I
For example,I want to make a layout like this: The 'header' can have a
I want to make a progress bar that fills up every time a user
i had soulation .i want to make navigation bar with items i will select

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.