Handle Graphics
What are handles? Matlab uses handles to point to all of the various graphical objects.
help plotNotice the mention of handles?
"PLOT returns a column vector of handles to LINE objects, one handle per line."Let's create a plot with multiple lines and then investigate the handles.
x = [0:.1:2; .5:.1:2.5; 1:.1:3]'*pi; y = sin(x); y(:,2)=y(:,2)+3; y(:,3)=y(:,3)-2; % without handles figure plot(x(:,1),y(:,1),'bx--','linewidth',2); hold on plot(x(:,2),y(:,2),'g','linewidth',2); plot(x(:,3),y(:,3),'r','linewidth',2); grid on legend('0 shift','+3 shift','-2 shift') % using handles figure h = plot(x,y); grid on legend('0 shift','+3 shift','-2 shift') get(h(1)) set(h(1)) set(h(1),'linestyle','--','marker','x'); set(h,'linewidth',2);Look in the ? menu and click on "Handle Graphics Property Browser" in the Contents section for a complete listing.
f = gcf a = gca