bar plot with trend line
8 次查看(过去 30 天)
显示 更早的评论
hi all
i am trying to make a plot that looks like the following:
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
how to get trendline on two sets of data?
thank you!
0 个评论
回答(2 个)
Azzi Abdelmalek
2012-9-9
x1=[1 3 5];x2=[2 4 6];
y1=[3 1 5];y2=[4 3 3]
bar_widh=0.2;
bar(x1,y1,bar_widh,'r');hold on; bar(x2,y2,bar_widh,'g')
hold on;plot(x1,y1,'b');hold on; plot(x2,y2,'m')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!