Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Matlab: Changing the line properties of a loaded figure?
  2. hline = findobj(gcf, 'type', 'line');
  3.        
  4. set(hline,'LineWidth',3)
  5.        
  6. set(hline(1),'LineWidth',3)
  7. set(hline(2:3),'LineStyle',':')
  8. idx = [4 5];
  9. set(hline(idx),'Marker','*')
  10.        
  11. x = 0:0.1:2;
  12. plot(x,sin(x));
  13.  
  14. fig = gcf % get a handle to the current figure
  15. % get handles to the children of that figure: the axes in this case
  16. ax = get(fig,'children')
  17. % get handles to the elements in the axes: a single line plot here
  18. h = get(ax,'children')
  19. % manipulate desired properties of the line, e.g. line width
  20. set(h,'LineWidth',3)