Conflict between subplot and imagesc within a GUI.

Discussion in 'MATLAB' started by scaramanga, Dec 20, 2010.

  1. scaramanga

    scaramanga Guest

    Hello to everyone ,

    I'm encountering a problem with matlab using the GUIDE, I have created two push buttons, when I push the first one, I get two subplots embedded in a panel. So far, there is no problem, but when I push on the second button which is an imagesc command (with no subplot command) normally it should take all the figure embedded in the panel, but it is diplayed in the same figure than before in other word as a subplot below the first one of the last figure.

    How can i display it on the whole figure and hence delete the old subplots?

    I hope that I've been clear enough.

    Thanks for your help.
    scaramanga, Dec 20, 2010
    1. Advertisements

  2. You will have to use clf(), or delete() the old axes, or use subplot(1,1,1)
    Walter Roberson, Dec 20, 2010
    1. Advertisements

  3. scaramanga

    scaramanga Guest

    Unfortunately clf (as well as delete) clear all the figure i.e. my GUI window and if I use subplot(1,1,1) for the second button and I push on it first, then the figure I get is resized over all the GUI window.
    scaramanga, Dec 20, 2010
  4. Yes, but those behaviours are not problems, as you specifically asked
    "How can i display it on the whole figure". Did you perhaps mean "whole
    panel" instead? I do not have an immediate solution for that and I need
    to do something else now, sorry.
    Walter Roberson, Dec 20, 2010
  5. scaramanga

    scaramanga Guest

    Yes I meant all the panel, sorry ....
    scaramanga, Dec 20, 2010
  6. Okay, I'm back again.

    subplot(1,1,1,'Parent', HandleOfPanel);

    Note though that although subplot(1,1,1) is treated as a special case
    according to the documentation, that subplot(1,1,1,'Parent', HandleOfPanel)
    appears to do just what you would like to have happen.
    Walter Roberson, Dec 20, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.