scatter3 not working

조회 수: 7 (최근 30일)
Magdalena Malenda
Magdalena Malenda 2016년 12월 6일
답변: Steven Lord 2016년 12월 8일
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
David Barry
David Barry 2016년 12월 6일
Please upload some example code and tell us what error you are getting.

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

답변 (2개)

Star Strider
Star Strider 2016년 12월 6일
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

Steven Lord
Steven Lord 2016년 12월 8일
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.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by