how to write callback for check box
13 views (last 30 days)
Show older comments
hi how to write code to remove plot by unchecking check box.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox1
data=get(handles.uitable1,'data');
plot(data(:,1),data(:,2));
as per above callback i am able to plot when checkbox is checked, please guide me how to write code for unchecking checkbox so that plot gets deleted
0 Comments
Accepted Answer
Walter Roberson
on 4 Feb 2013
if get(hObject, 'Value')
handles.plot = plot(data(:,1),data(:,2));
else
delete(handles.plot);
handles.plot = [];
end
guidata(hObject, handles);
0 Comments
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!