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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:37:50+00:00 2026-05-26T04:37:50+00:00

I looked and couldn’t find an answer for this question, so here goes. I

  • 0

I looked and couldn’t find an answer for this question, so here goes.

I have some data (a 1 X 1000 vector called data) that I would like to plot the histogram information for. If I use the histogram(data) command then I get a nice enough histogram plot where the x-axis is the divided evenly into ten buckets (midpoint values of the ten equal intervals between the max and min values of the data) and the y-axis records how many occurances occured for each bucket.

What I really want is the same plot, just with the y-axis representing the bucket intervals, and the x-axis representing the count for each bucket…

That way I can stick it into a subplot next to some other information, and everything will be easier to understand (and look super cool). What’s an easy way to accomplish this? Thanks!

  • 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-26T04:37:50+00:00Added an answer on May 26, 2026 at 4:37 am

    You can achieve what you want using the barh function. Here’s an example:

    testData = randn(10000,1); %# test data
    [counts,bins] = hist(testData); %# get counts and bin locations
    barh(bins,counts)
    

    enter image description here

    Flipping the bar chart

    Here’s an example showing how to flip the chart along a vertical axis.

    h=barh(bins,counts); %# include previous two lines from above
    set(get(h,'Parent'),'xdir','r')
    

    enter image description here

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

Sidebar

Related Questions

I've looked around and couldn't find a distinct answer to this question. So I'm
Looked around, couldn't find this specific question discussed. Pretty sure the difference is negligible,
I've looked around for this but I couldn't find an answer, and I don't
I looked around and couldn't really find an answer on how to do this
This may be simple, but I looked around and couldn't find an answer. What's
This should be a fairly simple question to answer. I looked around and couldn't
Looked through many answers, but couldn't find one solving this. I have four (potentially
I have looked through stack overflow and couldn't really find an answer. I have
I have looked through the site and couldn't find a question that solved my
I've looked through different posts here and couldn't find the answer.. check the source

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.