problem with grouped data in bar plot
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (1)
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
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');
See Also
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!