Bar chart plotting of two series
Show older comments
Hi I have tried everything I know to try and have not been able to solve this problem. I use MATLAB to create GIFs of graphs and one particular use is creating a GIF of an incrementing bar chart with multiple Y series. For whatever reason MATLAB refuses to plot only the first X value and the first Y1 and Y2 values per the example below where I'm using two financial series as the Y1 and Y2 examples.
bar(data.Year(1),[data.SP500(1) data.EM(1)])
Error using bar (line 143)
X must be same length as Y.
If I change the example to only one Y series or two data points for X, Y1 and Y2 it works fine but it gives me the error above when trying to plot only one value for X, Y1 and Y2.
Appreciate any help,
JK
Accepted Answer
More Answers (1)
Jared
on 19 Aug 2018
0 votes
Categories
Find more on Bar Plots 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!