Add custom legend without any relation to the graph
I wish to insert a legend that is not related to the graph whatsoever: figure; hold on; plot(0,0,'or'); plot(0,0,'ob'); plot(0,0,'ok'); leg = legend('red','blue','black'); Now I wish to add it to another figure: figure; t=linspace(0,10,100); plot(t,sin(t)); %% ADD THE LEGEND OF PLOT ABOVE This is how I have solved this problem in the past: figure t=linspace(0,10,100); plot(t,sin(t)); hold on; h = zeros(3, 1); h(1) = plot(NaN,NaN,'or'); h(2) = plot(NaN,NaN,'ob'); h(3) = plot(NaN,NaN,'ok'); legend(h, 'red','blue','black'); This will plot the additional points, but because the coordinates are at