Help with scatter plots with matrix having multiple columns

조회 수: 6 (최근 30일)
Nikhil Upadhyay
Nikhil Upadhyay 2012년 6월 29일
Hi,
I have data that needs to be plotted.
the X axis values are in a 20X1 vector. The Y axis values are in a 20X10 matrix. It has 10 columns for different set of measurements.
I need to plot them such that all points appear as dots (a scatter) and I also see a curve that fits (like an average or something).
Then I need to calculate the standard deviation etc. Essentially, I need to be able to see the scatter i.e. for each X value, there are 10 Y values. I need to see how the actual measurement points are located around the fit curve.
Any ideas?
Regards, Nikhil

답변 (1개)

Walter Roberson
Walter Roberson 2012년 6월 29일
pointsize = 8;
scatter( repmat(X(:),10,1), Y(:), pointsize );
For the other part, see
boxplot(Y)
There is no way to pass X to boxplot, so one would have to tweak the plot outputs in order to get both on one graph. Though it just might work to use
plotyy( repmat(X(:),10,1), Y(:), X, Y, @scatter, @(X,Y) boxplot(Y) )
  댓글 수: 2
Nikhil Upadhyay
Nikhil Upadhyay 2012년 6월 29일
The first method works for me. Thanks! Now, I just need to draw one curve that looks like a fit for the data. Any suggestions?
Walter Roberson
Walter Roberson 2012년 6월 29일
plot( x, mean(Y, 2) )

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by