How can i plot the projection of 3d on 2d?

Hi everyone,
My data is in x, y, z form. I am trying to plot the projection of 3d on 2d.
Here is my sampel attempt:
X=1:1:100;
Y=1:1:100;
Z=1:1:100;
scatter3(x,y,z)
What is get so far:
What i am looking for:
Thank you!

2 Commenti

Your data is such.....you need to have data with the spatial variation.
yes, the orginal data set have spairial variation, here i just want to see how can i plot such data in such a fashion.

Accedi per commentare.

Risposte (1)

KSSV
KSSV il 9 Nov 2022
Modificato: KSSV il 9 Nov 2022
X=1:1:100;
Y=1:1:100;
Z=1:1:100;
figure
hold on
scatter3(X,Y,Z,[],Z,'filled')
scatter(X,Y,[],Z,'filled')
view(3)

6 Commenti

@KSSV I rquire to plot the 2d proejction on the same plot at top same as in the attched figure.
@KSSV teh updated figure looks good, can we plot the 2d view on top like in the examplery figure.
Try the given lines with your data.
@KSSV, I try with the orginal data but did not get any output, here is the data,..
dat=load('dd.csv');
X=dat(:,1);
Y=dat(:,2);
Z=dat(:,3);
figure
hold on
scatter3(X,Y,Z,[],Z,'filled')
scatter(X,Y,[],Z,'filled')
view(3)
dat=readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1186483/dd.csv/dd.csv');
X=dat.(1);
Y=dat.(2);
Z=dat.(3);
figure
hold on
scatter3(X,Y,Z,[],Z,'filled')
scatter(X,Y,[],Z,'filled')
view(3)
colormap(jet)
@KSSV i am trying to make similar plot while using online matlab but did not get any output. Plus, I want to plot the 2d view on top on the figure instea dof the bottom and the y axis shoudl be in revesre order.
thank you!

Accedi per commentare.

Categorie

Prodotti

Tag

Richiesto:

il 9 Nov 2022

Commentato:

il 9 Nov 2022

Community Treasure Hunt

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

Start Hunting!

Translated by