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 Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by