Plot not disappearing when using STOP button and visible off

function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%handles.stop_now=1;
%guidata(hObject, handles);
set(handles.pushbutton3,'userdata',1)
set(handles.axes4,'visible','off');
I have created pushbutton to stop the programme. Simultaneously it should make the plot in handles.axes4 invisible. However the axes get invisbile put plot remains. How to rectify the same

 Respuesta aceptada

Read this
Try this
set(handles.axes4,'visible','off');
set(get(handles.axes4,'Children'),'Visible','off')
I think it will work

5 comentarios

Thanks a lot. It works. Thanks
One more question. If i want to print the graph in handles.axes4. How to go about it.
s = [1 1 1 2 2 3 3 4 5 5 6 7];
t = [2 4 8 3 7 4 6 5 6 8 7 8];
G = graph(s,t)
plot(handles.axes4,G)
I meant that a graph is being generated in handles.axes4 already. If i want to print that graph or save it can it be done
do you mean shift that to new figure
or save it as a figure

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Preguntada:

el 8 de Mzo. de 2021

Comentada:

el 9 de Mzo. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by