Plot colors not showing up in Matlab R2020a Student Version

조회 수: 6 (최근 30일)
Ashraf Rafiza
Ashraf Rafiza 2020년 6월 9일
답변: Steven Lord 2020년 6월 9일
Hi everyone! I have a problem. In my scatter plot, the legend show the correct color code for each plot category but in the graph, the colour are all the same. I have tried to change the colour code in my command but it seems to follow my last colour codes in the command. This is my command>>
figure
hold on
grid on
scatter(x(w1),y(w1),'y','filled')
scatter(x(w2),y(w2),'m','filled')
scatter(x(w3),y(w3),'c','filled')
scatter(x(w4),y(w4),'r','filled')
scatter(x(w5),y(w5),'g','filled')
scatter(x(w6),y(w6),'b','filled')
scatter(x(w7),y(w7),'k','filled')
xlabel('Expected Departure Time (hrs, mins)')
ylabel('Delayed Time (hrs, mins)')
legend('Delay>60mins','Delay 31mins to 60mins)','Delay 16mins to 30mins','Delay 5mins to 15mins','On Time','Earlier 5mins to 15mins','Earlier>15mins')
hold off

답변 (1개)

Steven Lord
Steven Lord 2020년 6월 9일
Are all the earlier points plotted over by points in the last category? Look at the figure after each scatter call to see if this is the case.

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by