make axes invisible or delete plot completely

前端 未结 4 671
既然无缘
既然无缘 2021-01-19 05:24

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 calculat

4条回答
  •  半阙折子戏
    2021-01-19 05:42

    You have use the handles to the subplots and plots:

    h(1)=subplot(221);
        p(1)=plot(rand(10,1));
    h(2)=subplot(222);
        p(2)=plot(rand(10,1));
    h(3)=subplot(223);
        p(3)=plot(rand(10,1));
    h(4)=subplot(224);
        p(4)=plot(rand(10,1));
    
    
    set([h(2) p(2)],'visible','off')
    

    hides the 2nd plot. @Jonas answer seems more complete however. It's certainly easier, because you don't have to collect the children yourself manually as I did here.

提交回复
热议问题