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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:57:29+00:00 2026-05-20T23:57:29+00:00

I’m wondering if it is possible to get the same grouping behavior of bar

  • 0

I’m wondering if it is possible to get the same grouping behavior of bar plots into bar3.
For example, if you plot

  bar(rand(3));

you get 3 bars for each point; bar groups the different y values for each x. Now I would like to do the same with a 3D data. That is that I have several slices of 2D data that I want to visualize as groups of bars. Then, if my data is

data = rand(3,3,2);

I would like to see data(1,1,:) as a group of bars, and data(1,2,:) as another group and so on.

Is it possible? I cannot find a way of achieving this.

Edit: I’m adding more details, to explain it better.

Lets said that we have two, or more, sets of data {x_(i,j)^s}. What I need is to group in the same grid position (i,j), all the sets s. In this question, they are grouping the data sets side by side, not element-wise, like this:

x1(s1) x1(s2) x1(s3)   x2(s1) x2(s2) x2(s3)   x3(s1) x3(s2) x3(s3)
x4(s1) x4(s2) x4(s3)   x5(s1) x5(s2) x5(s3)   x6(s1) x6(s2) x6(s3)
x7(s1) x7(s2) x7(s3)   x8(s1) x8(s2) x8(s3)   x9(s1) x9(s2) x9(s3)

I would like the bar command behavior, it tends to group when putting more than one data set. I would like to know if it is possible.

  • 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-20T23:57:30+00:00Added an answer on May 20, 2026 at 11:57 pm

    I am not sure I fully understood, but if you are looking for grouped behavior like you mention with bar(rand(3)) then you can try

    figure; bar3(rand(5),'grouped');
    % or maybe
    figure; bar3(rand(5),'stacked');
    

    or try to rearrange the data in data so it can work better with bar3 with reshape:

    data = rand(3,3,2);
    % now each data(i, j, :) will be in single row 
    changeddata = reshape(data , [size(data , 1)*size(data , 2) 2]);
    figure; bar3(changeddata);
    figure; bar3(changeddata ,'grouped');
    figure; bar3(changeddata ,'stacked');
    

    Maybe if you can give a code example for how it’s supposed to look in one group, it would help to understand your question better.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

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.