4D scatterplot with one indicator value

Hello,
I have four vectors: s1, s2, s3 as parameter vectors and vector i with indicator values of 0 or 1.
I would like to plot all s1-s2-s3 parameter combinations with value i = 1 with one color and all other s1-s2-s3 parameter combinations with value i = 0 with another color.
Thank you.

 채택된 답변

Walter Roberson
Walter Roberson 2011년 7월 23일

0 개 추천

pointsize = 8;
[s1g, s2g, s3g] = ndgrid(s1, s2, s3);
scatter3(s1g, s2g, s3g, pointsize, i);
colormap([1 0 0;0 1 0]);
However, before you do this, you will have to convert i from being a vector to being a matrix defined at each s1 x s2 x s3 possibility.

댓글 수: 2

Tom
Tom 2011년 7월 23일
Thanks, but I am not sure if I understand you correctly about coverting the vector to being a matrix. I did:
INEQ = [i DLparams1 DLparams2 DLparams3]
pointsize = 8;
[s1g, s2g, s3g] = ndgrid(DLparams1, DLparams1, DLparams1);
scatter3(s1g, s2g, s3g, pointsize, INEQ);
colormap([1 0 0;0 1 0]);
Error message.
Walter Roberson
Walter Roberson 2011년 7월 23일
Now that I think of it, I was wrong about wanting to do the reshape.
If DLparams1 and DLparams2 and DLparams3 and "i" are vectors that are all the same length, then
pointsize = 8;
scatter3(DLparams1, DLparams2, DLparams3, pointsize, i);
colormap([1 0 0;0 1 0]);

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

추가 답변 (0개)

카테고리

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

질문:

Tom
2011년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by