Worry about scatter3 plot
4 views (last 30 days)
Show older comments
Idossou Marius Adom
on 7 Jan 2021
Commented: Idossou Marius Adom
on 8 Jan 2021
Hi all. Wish you good and happy new year !
I plot data in 3-D in Matlab with the scatter3 command. It works well, but the figure bothers me a bit, and this is why:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/481398/image.png)
The z coordinate for the point BDI is 32.4 and that of the point TGO is 30.6. My concern is that both points seem to be under the z = 30 line, and TGO even seems to be slightly higher than BDI although its z coordinate is lower. I am conscious that view in 3-D is not that easy and som deformations may happen. For example, in 2-D there is no problem:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/481403/image.png)
Does my worry make sens ? And in the case, is there any way to better plot the figure in 3-D ? Here is my code (for the 3-D figure):
figure
scatter3(Data.kfprop,Data.mpropkf*100,Data.abd,'marker','none');
dx = -1.5;
text(Data.kfprop+dx,Data.mpropkf*100,Data.abd,Data.isocode3);
xl = xlabel('X');
xl.HorizontalAlignment = 'left';
xl.Rotation = 16;
xl.Position(3) = xl.Position(3)+0;
yl = ylabel('Y');
yl.HorizontalAlignment = 'right';
yl.Rotation = -27;
yl.Position(1) = yl.Position(1)+0;
zlabel('Z');
Thank you for your help.
0 Comments
Accepted Answer
Cris LaPierre
on 7 Jan 2021
It's an optical illusion because your axes are rotated/tilted. This is causing the grid line in the back (for Z=30) to appear higher than your data points. You could try rotating your plot to try and find a better viewing angle (or use the view function).
More Answers (0)
See Also
Categories
Find more on Annotations 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!