Clear Filters
Clear Filters

plot3 for three dimension data

1 view (last 30 days)
fred bnm
fred bnm on 13 Dec 2018
Answered: Star Strider on 13 Dec 2018
i want using plot3 for display three dimension data. size of data is (400*3) that contain two class. size of class A is 300 and size of class B is 100.
but after run this code z axis is not showing.
please guide me.
Fspace = rand(400,3);
figure;hold on;
plot3(Fspace(1:300,1),Fspace(1:300,2),Fspace(1:300,3),'b*');
plot3(Fspace(301:400,1),Fspace(301:400,2),Fspace(301:400,3),'ro');
legend('Class A','Class B');
% axis equal;
xlabel('x');
ylabel('y');
zlabel('z');
title('original data');

Accepted Answer

Star Strider
Star Strider on 13 Dec 2018
I can’t determine why it’s not automatically displaying.
Use the view (link) function to make it magically appear:
Fspace = rand(400,3);
figure
hold on;
plot3(Fspace(1:300,1),Fspace(1:300,2),Fspace(1:300,3),'b*');
plot3(Fspace(301:400,1),Fspace(301:400,2),Fspace(301:400,3),'ro');
hold off
legend('Class A','Class B');
% axis equal;
xlabel('x');
ylabel('y');
zlabel('z');
title('original data');
grid on
view(-30, 45)

More Answers (0)

Categories

Find more on Graphics Object Identification in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!