bar plot with trend line

hi all
i am trying to make a plot that looks like the following:
how to get trendline on two sets of data?
thank you!

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 9 日

2 投票

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')
Image Analyst
Image Analyst 2012 年 9 月 9 日

0 投票

bar(x,y);
hold on;
plot(x,y, 'k-');

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2012 年 9 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by