1、创建画布
this.Position(1)=105;
this.Position(2) = 895;
this.Position(3) =360;
this.Position(4) = 290;
set(this.uiPanel1,'Position',this.Position);
%Create UIPanel1
this.uiPanel1 = uipanel('Parent',this.Parent,...
'Units','pixels',...
'Position',this.Position,...
'Tag',sprintf('ToolbarPanel_%s',this.Tag),...
'Title','',...
'BackgroundColor',[191/255 191/255 191/255],...
'BorderType','none');
2、在画布上添加文字
%Create background Axes for gradient
this.bgAxes = axes('Parent',this.uiPanel,...
'Units','normalized',...
'Position',[0 0 0 0],...
'Tag',sprintf('SidebarBackground_%s',this.Tag));
this.TitleText = text(0,0,2,'OMMS',...
'Units','pixels',...
'Parent',this.bgAxes,...
'FontName','Arial Unicode MS',...
'FontSize',18,...
'FontWeight','bold',...
'Units','pixels',...
'Color',[30/255 30/255 30/255],...
'VerticalAlignment','middle',...
'HorizontalAlignment','center');
set(this.TitleText,'Position',[42, 65, 2]);