I have a set of dummy points and I am trying to make a legend with most of the markers being the same size but 3 of them being different sizes(can be based on the size of the points in the scatter plot or resized individually) list1-5 should have the same marker size and Phase A should have a larger marker size Phase B should have the normal marker size and Phase C should have a small marker size. The text should remain the same in all cases.
figure hold on %sets up data for the legend
list1 = scatter(NaN,NaN, 40, 'r', 'filled'); list1.MarkerEdgeColor = 'k'; list2 = scatter(NaN,NaN, 40, 'y', 'filled'); list2.MarkerEdgeColor = 'k'; list3 = scatter(NaN,NaN, 40, 'g', 'filled'); list3.MarkerEdgeColor = 'k'; list4 = scatter(NaN,NaN, 40, 'c', 'filled'); list4.MarkerEdgeColor = 'k'; list5 = scatter(NaN,NaN, 40, 'm', 'filled'); list5.MarkerEdgeColor = 'k'; list6 = scatter(NaN,NaN, 90, 'w', 'filled'); list6.MarkerEdgeColor = 'k'; list7 = scatter(NaN,NaN, 40, 'w', 'filled'); list7.MarkerEdgeColor = 'k'; list8 = scatter(NaN,NaN, 10, 'w', 'filled'); list8.MarkerEdgeColor = 'k'; lgd = legend([list1 list2 list3 list4 list5 list6 list7 list8], 'list1',... 'list2', 'list3', 'list4', 'list5', 'Phase A',... 'Phase B', 'Phase C','AutoUpdate ','Off', 'Location', 'northwest');
Best Answer