Descriptive statistics on scatter plot

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

답변 (1개)

Abel Babu
Abel Babu 2017년 5월 30일
편집: Abel Babu 2017년 5월 30일

0 개 추천

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');
More about annotations can be found here: http://in.mathworks.com/help/matlab/ref/annotation.html
Abel

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

질문:

2017년 5월 25일

편집:

2017년 5월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by