Multiple histograms and what will be the best way to put mean and std of data into a plot?

2 ビュー (過去 30 日間)
alpedhuez
alpedhuez 2020 年 8 月 15 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 15 日
I will have three histograms in one plot
histogram(A)
hold on
histogram(B)
hold on
histogram(C)
I now want to get mean and std of A, B, and C displayed in a plot. I learned legend() for one histogram. Is there any simple way to put all these six information in a text box of a plot?

回答 (1 件)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 8 月 15 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 15 日
You can use text function to add annotations anywhere on the plots. By the way, If A, B, and C are column vectors, it is wiser to plot them at once without need for hold on:
histogram ([A,B,C]);
However if you need to draw them separately, it's cleaner to use hold on like this:
hold on
plot ();
scatter ();
histogram ();
% and any other plots
hold off

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by