Descriptive statistics on scatter plot
2 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have a series x.
What I would like to do is:
- Draw a scatterplot of x - On the scatter plot, I would like to output the basic descriptive statistics such as *Mean *Std *# of samples
0 件のコメント
回答 (1 件)
Abel Babu
2017 年 5 月 30 日
編集済み: Abel Babu
2017 年 5 月 30 日
Hi,
If your question is along the lines of adding the mean and standard deviation as annotation over the scatter plot, try the following code snippet:
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
scatter(x,y)
meanVal = mean(y);
stdVal = std(y);
dim = [.2 .5 .3 .3];
str = sprintf('Mean: %f\n Std: %f',meanVal,stdVal);
annotation('textbox',dim,'String',str,'FitBoxToText','on');
Abel
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!