Plot colors not showing up in Matlab R2020a Student Version

3 次查看(过去 30 天)
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