Bar plot problem with legend
1 次查看(过去 30 天)
显示 更早的评论
If I have
A1 =
1.0e-013 *
Columns 1 through 8
0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574
Column 9
0.1465
And
A2 =
1.0e-013 *
Columns 1 through 8
0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523
Column 9
0.1465
How can I plot either variables, on the same bar plot?
bar([A1 A2])
legend('A1,'A2')
If MATLAB said:
Warning: Ignoring extra legend entries.
> In legend at 278
What's the mistake?
0 个评论
采纳的回答
Azzi Abdelmalek
2014-1-31
编辑:Azzi Abdelmalek
2014-1-31
A1 =1.0e-013 *[ 0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574]
A2= 1.0e-013 *[0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523]
bar([A1' A2'])
legend('A1','A2')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!