x = 0:1:1;
y = 0:1:1;
z = 0:1:1;
scatter3(x,y,z,200,'blue','filled')
xlabel('x')
ylabel('y')
zlabel('z')
1. How do i show all the corner points and add more grid so that its clear they are the corner point (don't want them just floating there)?
2. How do i add a lable for each corner point (e.g, at x=1, y=1 and z=0)
3. Is there a way to show some of the points as filled and other not filled dots?

 採用された回答

Star Strider
Star Strider 2022 年 5 月 15 日

0 投票

There are only two points, so I am not certain what you want for the others.
One option could be to use stem3 instead —
x = 0:1:1;
y = 0:1:1;
z = 0:1:1;
stem3(x,y,z, 'b', 'filled', 'MarkerSize',15, 'LineWidth',2.5)
xlabel('x')
ylabel('y')
zlabel('z')
.

4 件のコメント

HabenG
HabenG 2022 年 5 月 15 日
So what do i have to do if i want to show a point at each corner?
Star Strider
Star Strider 2022 年 5 月 15 日
There are no points at the other corners. You are free to add them if you wish.
One option is to set the 'BoxStyle' to 'full'.
x = 0:1:1;
y = 0:1:1;
z = 0:1:1;
figure
stem3(x,y,z, 'b', 'filled', 'MarkerSize',15, 'LineWidth',2.5)
hold on
% scatter3([0 1 0 1 1 0 1 0], [0 1 0 0 1 1 0 1], [0 1 1 0 0 0 1 1],'.') % 3D Plot Corners
hold off
view(-30,30)
grid on
box on
set(gca,'BoxStyle','full')
xlabel('x')
ylabel('y')
zlabel('z')
HabenG
HabenG 2022 年 5 月 15 日
編集済み: HabenG 2022 年 5 月 15 日
I don't see how this any different than your earlier response. My issue is, i cant add the corner point to the plot. If you know how to do that in any way please post it here.
thanks
Star Strider
Star Strider 2022 年 5 月 15 日
Try this —
x = 0:1:1;
y = 0:1:1;
z = 0:1:1;
figure
scatter3([0 1 0 1 1 0 1 0], [0 1 0 0 1 1 0 1], [0 1 1 0 0 0 1 1],'.r') % 3D Plot Corners
hold on
scatter3(x,y,z,200,'blue','filled')
hold off
view(-30,30)
grid on
box on
% set(gca,'BoxStyle','full')
xlabel('x')
ylabel('y')
zlabel('z')
It plots a red dot in every corner.
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2022a

質問済み:

2022 年 5 月 15 日

コメント済み:

2022 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by