在matlab中为什么某些组件丢失或部分被遮挡

学习和分享。

东西/原料

  • matlab软件
  • 电脑

方式/步调

  1. 1

    恢复编程结构

    此代码建立一个图形,其顶部面板包含一个轴,底部面板包含一个按钮和弹出菜单。

    hf = figure; 

  2. 2

    hb = uicontrol('Style','PushButton',...              

           'String','Plot',...              

           'Position',[175, 40, 60, 25]); 

  3. 3

    hpulabel = uicontrol('Style','text',...                     

           'String', 'Plot Type',...                     

           'Position', [300, 65, 60, 20]); 

  4. 4

    hpu = uicontrol('Style', 'popupmenu',...                

           'String', {'bar', 'plot', 'stem'},...               

           'Position',[310, 40, 60, 25]); 

  5. 5

    topp = uipanel('Title', 'Plot',...               

           'Position',[0 .25 1 .75]);

  6. 6

    ah = axes('Position', [.10, .35 .80 .60]); 

  7. 7

    bottomp = uipanel('Title','Plotting Options',...                  

           'Position',[0 0 1 .25]);

    END

方式/步调2

  1. 1

    hf = figure;

  2. 2

    topph = uipanel('Parent', hf,'Title', 'Plot',...

                    'Position',[0 .25 1 .75]);

  3. 3

    axes('Parent', topph, 'Position', [.10, .35 .80 .60]);

  4. 4

    bottomph = uipanel('Parent', hf,'Title','Plotting Options',...

                       'Position',[0 0 1 .25])

  5. 5

    hpulabel = uicontrol('Parent', bottomph, 'Style','text',...

                         'String', 'Plot Type',...

                         'Position', [300, 65, 60, 20]);

  6. 6

    hb = uicontrol('Parent', bottomph, 'Style','PushButton',...

                   'String','Plot',...

                   'Position',[175, 40, 60, 25]);

  7. 7

    hpu = uicontrol('Parent', bottomph, 'Style', 'popupmenu',...

                    'String', {'bar', 'plot', 'stem'},...

                    'Position',[310, 40, 60, 25]);

    END
  • 发表于 2020-03-08 20:55
  • 阅读 ( 904 )
  • 分类:其他类型

0 条评论

请先 登录 后评论
联系我们:uytrv@hotmail.com 问答工具