4D scatterplot with one indicator value
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Walter Roberson
on 23 Jul 2011
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 Comments
Walter Roberson
on 23 Jul 2011
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]);
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!