Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8354507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:34:06+00:00 2026-06-09T09:34:06+00:00

I have a matlab gui that shall contain 4 plots. The first plot shall

  • 0

I have a matlab gui that shall contain 4 plots. The first plot shall be updated if a different file is selected in a list. the other 3 shall only be visible (and be calculated) on request.

However I fail to make plots 2-4 invisible after they have been plotted once.

I tried

set(handles.axesImage, 'Visible', 'off');

but that only deletes the axis, not the whole plot.

EDIT:
Instead of making things unvisible, is it also possible to actually delele the content? Typically I would call close(hfig);, but here i have no figure.

I tried

handles2hide = [axisObj;cell2mat(get(axisObj,'Children'))]; 
delete(handles2hide);

But that fails for the unplotted axes (after startup)

EDIT:
I changed the code to:

axisObj = handles.axesContour;
if ishandle(axisObj)
    handles2delete = get(axisObj,'Children');
    delete(handles2delete);
    set(axisObj,'visible','off') 
end
if (isfield(handles,'contour') && isfield(handles.contour,'hColorbar'))
    delete(handles.contour.hColorbar);
    delete(handles.contour.hColorbarLabel);
end

However the colorbar remains undeleted and handles.contour.hColorbar fails with Invalid handle object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:34:08+00:00Added an answer on June 9, 2026 at 9:34 am

    I now solved it with

    function z_removePlots(handles)
    
    if (isfield(handles,'image') && isfield(handles.image,'hplot'))
        if ishandle(handles.image.hplot)
            delete(handles.image.hplot);
            delete(findall(gcf,'tag','Colorbar'));
            handles.image.hplot = 0;
            set(handles.axesImage, 'Visible', 'off');
        end
    end
    if (isfield(handles,'contour') && isfield(handles.contour,'hplot'))
        if ishandle(handles.contour.hplot)
            delete(handles.contour.hplot);
            handles.contour.hplot = 0;
            ClearLinesFromAxes(handles.axesContour)
            set(handles.axesContour, 'Visible', 'off');
        end
    end
    guidata(handles.output,handles);
    

    with

    function ClearLinesFromAxes(axisObj)
    if ishandle(axisObj)
        handles2delete = get(axisObj,'Children');
        delete(handles2delete);
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a matlab GUI....I'd like to load ANY file type(doc,txt,dat,xls) into matlab as
I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092
I have a matlab script, lets call it master.m, that loads a file called
I have an object-oriented MATLAB app that needs a GUI, and I'd like to
I have GUI in Matlab that I have made using the Programmatic approach. It
I have a MATLAB GUI and a separate application that writes data to a
With Guide I made a Matlab Gui that have 10 Axes in which i
I have an assignment to create a GUI using MATLAB GUIDE and am having
I have matlab file matlab_param.m function matlab_param(param1, param2) disp(sprintf('param1 : %s', param1)); disp(sprintf('param2 :
I have a Matlab function that creates a cell array with matrixes inside. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.