Scatter3 not displaying anything

1 view (last 30 days)
Nicolas Gandar
Nicolas Gandar on 13 Apr 2018
Edited: Steven Lord on 13 Apr 2018
I have a 3D vector called space where each column holds the position of the point and I want to display that.
This the code I have:
points_size=0.3;
h = scatter3(space(:,1),space(:,2),space(:,3),points_size,'filled');
It does not show anything so I tried to run a few tests as suggested by someone in the community:
ax = ancestor(h, 'axes')
f = ancestor(h, 'figure')
f.Visible
f.Position
f.Units
And these are the results:
x =
Axes with properties:
XLim: [0 4]
YLim: [0 4]
XScale: 'linear'
YScale: 'linear'
GridLineStyle: '-'
Position: [1×4 double]
Units: 'normalized'
Show all properties
f =
Figure (1) with properties:
Number: 1
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [360 278 560 420]
Units: 'pixels'
Show all properties
ans =
'on'
ans =
360 278 560 420
ans =
'pixels'
Can anyone help make sense of what is given here? What is f.position?
Thank you

Answers (1)

Steven Lord
Steven Lord on 13 Apr 2018
Edited: Steven Lord on 13 Apr 2018
According to the documentation page for scatter3, the default marker area is 36 points squared. [A point is 1/72 of an inch.] Your call to scatter3 sets the area of each marker to 0.3 points squared. scatter3 creates the plot, but all the markers are so tiny they might as well not be there.
Change your 0.3 to something larger (like the default of 36) or leave it blank (in which case it will use the default.)

Community Treasure Hunt

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

Start Hunting!