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

  • Home
  • SEARCH
  • 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 670549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:16:35+00:00 2026-05-14T00:16:35+00:00

I want to plot stacked histograms in R; i.e. stack individual histograms in the

  • 0

I want to plot stacked histograms in R; i.e. stack individual histograms in the third dimension.


thank you all for your suggestions, especially the one by Shane.

@hadley, I agree with your points, however, my situation is different: the main point I’m trying to convey by plotting four stacked histograms is that the tails vary significantly….the part that will get obscured is of no consequence in the data I’m presenting….also, being able to read the frequency axis is also not important since I’ll be plotting the relative frequencies…

  • 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-05-14T00:16:35+00:00Added an answer on May 14, 2026 at 12:16 am

    You could try using either rgl (see here) or 3dscatterplot (as in this example). Lattice also supports this:

    library(lattice) 
    library(latticeExtra) 
    ?panel.3dbars
    

    You can see an example of this on the Learnr blog.

    I don’t believe that’s technically a stacked histogram (a stacked histogram stacks the bars on top of each other). Moreover, a different kind of histogram could be more informative: look at the ggplot2 the documentation here for some examples.

     hist_cut <- ggplot(diamonds, aes(x=price, fill=cut)) 
     hist_cut + geom_bar() # defaults to stacking 
    

    Another option is to use latticing instead, with facet_wrap in ggplot2 (see this post as an example).

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

Sidebar

Related Questions

I want a stacked barplot or at least two barplots (histograms) of the data
I want to plot a line from one well-defined point to another and then
I want to log onto Stack Overflow using OpenID, but I thought I'd set
I want to added dark/light phase information to the background of my stacked area
I am currently have a nx3 matrix array. I want plot the three columns
I want to plot some confidence interval graphs in MATLAB but I don't have
I want to plot a confusion matrix using Pylab. The class labels along the
I want to plot some data. The first column contains the x-data. But matplotlib
I want to plot a 3d graph in matlab By graph I mean in
Want to know what the stackoverflow community feels about the various free and non-free

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.