scatter3 not working
7 views (last 30 days)
Show older comments
Function scatter3 seems to not working in my matlab. Also when I run examples from references page ex. for Create3DScatterPlotExxample.m only empty coordinates system is displayed and I get no error message. I use MATLAB R2016b.
This is the example code:
figure
[X,Y,Z] = sphere(16);
x = [0.5*X(:); 0.75*X(:); X(:)];
y = [0.5*Y(:); 0.75*Y(:); Y(:)];
z = [0.5*Z(:); 0.75*Z(:); Z(:)];
scatter3(x,y,z)
1 Comment
Answers (2)
Star Strider
on 6 Dec 2016
The example works for me in R2016b as posted in the example.
The first possibility is to consider a path problem. See if running these two lines from your Command Window or your script solves it:
restoredefaultpath
rehash toolboxcache
0 Comments
Steven Lord
on 8 Dec 2016
Modify your last line to call scatter3 with an output argument.
h = scatter3(x, y, z)
Show what that displays. If that command does not throw an error, also show what these commands display.
ax = ancestor(h, 'axes')
f = ancestor(h, 'figure')
f.Visible
f.Position
f.Units
Those commands will show us information about the axes and figure in which the scatter plot should have been created. The last three commands will tell us if the figure is hidden or has been created off-screen.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots 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!