Mark - I think that you have the right idea. Your layer could just be a handle to a graphics object that you show or hide depending upon the state of the checkbox. For example, a checkbox callback could do
function checkbox1_Callback(hObject, eventdata, handles)
if get(hObject, 'Value') == 0
if isfield(handles,'hSin')
set(handles.hSin, 'Visible', 'off');
end
else
if isfield(handles,'hSin')
set(handles.hSin, 'Visible', 'on');
else
x = 0:0.01:8*pi;
y = 30*sin(x) + 30;
handles.hSin = plot(x,y, 'r.');
guidata(hObject, handles);
end
end
The above code (from a GUIDE-created GUI) shows or hides a sine curve based on the state/value of the checkbox. See the attached GUI for an example of a GUI that displays two curves (sets of points) over an image.