Adding a plot line (trend) to a group of bars

11 ビュー (過去 30 日間)
Osh
Osh 2017 年 9 月 28 日
コメント済み: KSSV 2017 年 9 月 28 日
I have generated the following groups of bars in Matlab (v.2015b).
Now for each group of bars I want to plot a line, that represents some more information about each group. For example, a single group (D1 for example) must look like this:

回答 (1 件)

KSSV
KSSV 2017 年 9 月 28 日
A = randn(1000,1);
h = hist(A) ;
bar(h)
hold on
plot(1:length(h),h,'r')
  2 件のコメント
Osh
Osh 2017 年 9 月 28 日
This works if I had a single bar group (or simply one single bar chart). How do I repeat this plot line for each of the groups (D1,D2,D3,D4..D6) in the above multi-group graph?
KSSV
KSSV 2017 年 9 月 28 日
Run it for each group...use hold on to plot.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by