# How to plot a 3d graph with projection of 3d axis values on to the 2d surface with vertical lines

3 Ansichten (letzte 30 Tage)
Vinay Killamsetty am 4 Jun. 2020
Hi guys,
Can any one help me out in plotting a 3d graph with projection of 3d axis values on to the 2d surface with vertical lines.
Example image is attached.
Let me know If there is any simple solution for this
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
Tommy am 4 Jun. 2020
Should these vertical lines only be plotted for a subset of the data?

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

KSSV am 4 Jun. 2020
Bearbeitet: KSSV am 4 Jun. 2020
N = 100 ;
x = rand(N,1) ; y = rand(N,1) ; z = rand(N,1) ;
% pick some points from above to draw vertical lines
idx = randperm(N,10) ;
x1 = x(idx) ; y1 = y(idx) ; z1 = z(idx) ;
x2 = x(idx) ; y2 = y(idx) ; z2 = 0*z(idx) ;
% draw vertical lines
plot3(x,y,z,'ob')
hold on
plot3([x1 x2]',[y1 y2]',[z1 z2]','r')
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
Vinay Killamsetty am 5 Jun. 2020
Thank you very much

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange

R2019b

### Community Treasure Hunt

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

Start Hunting!

Translated by