-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathClickableLegend.m
48 lines (37 loc) · 1.19 KB
/
ClickableLegend.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function [ hLegendObj ] = ClickableLegend( varargin )
% ----------------------------------------------------------------------------------------------- %
%[ ] = DetectAlgMain( )
% Main function to run the 'Detect' algorithm
% Input:
% - xxx - Input Paramseter.
% Structure: Matrix.
% Type: 'Single' / 'Double'.
% Range: [0, 1].
% Output:
% - xxx - Constants Struct.
% Structure: Struct.
% Type: 'Single' / 'Double'.
% Range: [ ].
% References
% 1. R
% Remarks:
% 1. P
% 2. C
% TODO:
% 1. Adds
% Release Notes:
% - 1.0.000 07/03/2016 Royi Avital
% * First realease version.
% ----------------------------------------------------------------------------------------------- %
% Create Legend
hLegendObj = legend(varargin{:});
set(hLegendObj, 'ItemHitFcn', @ToggleVisibility);
end
function [ ] = ToggleVisibility( hLegendObj, sEventData )
switch(sEventData.Peer.Visible)
case('on')
sEventData.Peer.Visible = 'off';
case('off')
sEventData.Peer.Visible = 'on';
end
end