Costume Legend - Matlab

posted Oct 11, 2008, 7:37 AM by Ofer Fridman   [ updated Oct 11, 2008, 7:52 AM ]
This practical code sample for usage of partial or grouped legend - hence, displaing legend not for all the graphs on the plot.
By saving the handles for every line needed to have description.

Code

%get the figure handle
h=figure;
%get the line handle
child_handles = findobj(h,'Type','line');
%child_handles is stord last in first index
%meening index 1 is the last line that was drown
Lh=child_handles(1);

Sample code attached.
ċ
Partiallegand.m
(1k)
Ofer Fridman,
Oct 11, 2008, 7:51 AM
Comments