Sameh K. Mohamed
Sameh K. Mohamed

Reputation: 2333

3D scatter on GUI axes

I've a problem with doing scatter3 in my gui axes, that the scatter3 function do not support passing the axes handle as a parameter.


Function syntax from Mathworks documentation [ There is nothing about axes handle ]

scatter3(X,Y,Z,S,C)
scatter3(X,Y,Z)
scatter3(X,Y,Z,S)
scatter3(...,markertype)
scatter3(...,'filled')
scatter3(...,'PropertyName',propertyvalue)
h = scatter3(...)

Assume that axes handle is hAxes. and here is a sample data from function documentation:

[x,y,z] = sphere(16);
X = [x(:)*.5 x(:)*.75 x(:)];
Y = [y(:)*.5 y(:)*.75 y(:)];
Z = [z(:)*.5 z(:)*.75 z(:)];
S = repmat([1 .75 .5]*10,numel(x),1);
C = repmat([1 2 3],numel(x),1);

Q1: How Can I do the 3D scatter plot on the axes with handle hAxes ?

Q2: What I've figure out is the problem happens with only one axes, the scatter plot appear in 2D as if it's a normal scatter.

What the problem could be ?

Upvotes: 1

Views: 1249

Answers (1)

Sameh K. Mohamed
Sameh K. Mohamed

Reputation: 2333

Answer 1:

Although it's not mentioned but it seems like axes handle can be passed normally, that this cab be trivially done by the following code:

scatter3(hAxes, X(:),Y(:),Z(:),S(:),C(:),'filled');

Answer2:

It's 3D but It need a rotation tool to get the view from different angles !

Upvotes: 1

Related Questions