problem with grouped data in bar plot

1 view (last 30 days)
A
A on 30 Sep 2014
Commented: Star Strider on 30 Sep 2014
matlab 2013b, Linux 64 bit:
I am encountering strange behavior when I try to generate a bar plot using grouped data. The figure that gets generated is a plot where both axes range from 0-1, and it is completely filled in:
This happens whether I use my own data, or the sample data given in the bar() help example (below):
Y = [5,2,1
8,7,3
9,8,6
5,5,5
4,3,2];
figure
bar(Y)
Generating a bar plot with ungrouped data seems to work fine. The code I use to generate my plots worked fine in 2012a on a mac. I can't find anything about this issue online, and don't really even know how to describe it to look for information on what is causing it

Answers (1)

Star Strider
Star Strider on 30 Sep 2014
That’s strange. When I use the data and commands you posted (copy-pasted and run with R2014a, Win 8-64), I get:
  2 Comments
A
A on 30 Sep 2014
Right, that is how it's supposed to work... I'm looking to see if anyone has any idea why it's not working in my case.
Star Strider
Star Strider on 30 Sep 2014
Since I can’t reproduce it, it’s difficult to suggest an approach to solving it. To start, I suggest you do some ‘handle diving’ to see what it’s actually doing.
For example, see what it’s using for its x- and y-data:
xd = get(get(gca, 'Children'), 'XData');
yd = get(get(gca, 'Children'), 'YData');
Explore the others by querying various Barseries Properties.

Sign in to comment.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!