⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 align_figure.m

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M
字号:
function align_figure(fig,valign,halign)

screen_size = get(0,'ScreenSize');
screen_width = screen_size(3); screen_height = screen_size(4);

pos = get(fig,'Position');
left = pos(1); bottom = pos(2);
width = pos(3); height = pos(4);

if strcmp(get(fig,'MenuBar'),'none')
  offset = 20;
  menus = findobj(get(fig,'Children'),'type','uimenu');
  for k = 1:length(menus)
    if strcmp(get(menus(k),'Visible'),'on')
      offset = 40;
      break;
    end
  end
else
  offset = 40;
end

switch valign
 case 'top'
  bottom = screen_height-height-offset;
 case 'center'
  bottom = (screen_height-height-offset)/2;
 case 'bottom'
  bottom = 0;
 otherwise
  error(['Invalid vertical alignment ''' halign '''.'])
end

switch halign
 case 'left'
  left = 0;
 case 'center'
  left = (screen_width-width)/2;
 case 'right'
  left = screen_width-width;
 otherwise
  error(['Invalid horizontal alignment ''' halign '''.'])
end

set(fig,'Position',[left bottom width height]);

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -