How to add legend in CIE diagram?
I have four points that I want to plot on CIE diagram. I am using the following command:
plotChromaticity
hold on
scatter([x_1 x_2 x_3 x_4],[y_1 y_2 y_3 y_4])
hold off
Now I want to add legend for these four points. For example: ‘red’, ‘blue’, ‘green’, and ‘yellow’.
How can I do that?
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
plotChromaticity
hold on
x = rand(1,4);
y=rand(1,4);
name =["red", "blue", "green", "yellow"
name = 1×4 string array
"red" "blue" "green" "yellow"
for i=1:length(x)
scatter(x(i), y(i), 'DisplayName', name(i));
end
hold off
legend
SEE COMPLETE ANSWER CLICK THE LINK