Search this blog!

Thursday, July 5, 2012

Multiple Legend in plot/subplot

I needed multiple legend on a plot for multiple data where data sizes were different. If try classical legend you get the following


    figure
  p1=plot(I_test(:,:,1),I_true(:,:,1),'r.');
  hold on
  p2=plot(RGB_test(:,1),RGB_ref(:,1),'g.');
    legend( 'true','calculated');
It does not give what I want !! Therefore.....continue reading..


Instead try the following to have different legend

 figure
  p1=plot(I_test(:,:,1),I_true(:,:,1),'r.');
  hold on
  p2=plot(RGB_test(:,1),RGB_ref(:,1),'g.');
  legend([p1(1) p2(end)], 'true','calculated');


















No comments:

Post a Comment