plot3 not functioning

10 views (last 30 days)
Ashraf Rafiza
Ashraf Rafiza on 10 Jul 2020
Edited: Walter Roberson on 3 Apr 2021
Hello ! I have a data on the number of aircraft and delay duration in each hour in a month of January. In order to see the relationship between the number of aircraft and delay duration in each hour, I want to create a 3D plot but after writing the command, the Matlab just plot it in 2D only. Can anyone help me? Thanks in advance.
The command are as below;
Y = readtable('WMKJDelayTot.xlsx')
Day = Y.Day;
Hour = Y.Time;
Delay = Y.Delay
NumAircraft = Y.NumAircraft;
DataTableWMKJ = table(Day,Hour,NumAircraft,Delay,More_Than_10_Hour,More_Than_5_Hour,More_Than_1_Hour,Below_60mins,Below_30mins,Below_15mins,OnTime);
figure
v = DataTableWMKJ.Day;
d = DataTableWMKJ.Hour;
r = DataTableWMKJ.NumAircraft;
hold on
plot3(v,d,r)
hold off
Then, the plot;
The data;

Answers (1)

Walter Roberson
Walter Roberson on 10 Jul 2020
When you "hold on" the view() is one of the things that is held. You are using hold on before you do any 3d plotting so the 2d view is the one held.
view(3)
to get the right view.
  1 Comment
Konstantin Ninidze
Konstantin Ninidze on 3 Apr 2021
Thank you so much. Really appreciate it!

Sign in to comment.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!