Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. %**** Optional guidelines
  2. figure(1)
  3. plot([2 2],[0,1],'k--'); hold on
  4.  
  5. %**** DATA
  6. N = 4;
  7. y=rand(5,N);
  8. x=1:1:5;
  9. for plotLoop=1:N;
  10. %* Plot
  11. figure(1)
  12. plot(x,y(plotLoop,:));
  13. hold on
  14. end
  15.  
  16. %*****LEGEND
  17. hLegend = legend(LegTxt,...
  18. 'interpreter','latex',...
  19. 'location','eastoutside')
  20.  
  21. %**** Optional guidelines for periodicity
  22. figure(1)
  23. plot([2 2],[0,1],'k--'); hold on
  24.  
  25. %**** DATA
  26. N = 4;
  27. y=rand(5,N);
  28. x=1:1:5;
  29.  
  30. for plotLoop=1:N;
  31. LegTxt{plotLoop} = num2str(plotLoop);
  32. %* Plot
  33. figure(1)
  34.  
  35. % if statement to construct a handle for the legend later
  36. if plotLoop==1
  37. htot=plot(x,y(plotLoop,:));
  38. else
  39. h=plot(x,y(plotLoop,:));
  40. % Append this info to the figure handle
  41. htot= [htot, h];
  42. end
  43. hold on
  44.  
  45. end
  46.  
  47. %*****LEGEND
  48. hLegend = legend(htot,LegTxt,...
  49. 'interpreter','latex','FontSize',16,...
  50. 'location','eastoutside')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement