-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_uisplitpane.m
35 lines (32 loc) · 1.2 KB
/
example_uisplitpane.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function example_uisplitpane
% Illustrates how to use uisplitpane.
%
% See also: uisplitpane, uisplitter
% Copyright 2010 Levente Hunyadi, http://hunyadi.info.hu
figure( ...
'Name', 'uisplitpane demo');
x = 0:100;
[bottom,top] = uisplitpane('Orientation','vert');
uicontrol(bottom, ...
'Style','text', ...
'Units','normalized', ...
'Position', [0 0 1 0.6], ...
'String','This is the bottom panel.');
[left,right] = uisplitpane(top,'Orientation','hor');
uicontrol(left, ...
'Style','text', ...
'Units','normalized', ...
'Position', [0 0 1 0.6], ...
'String','This is the left panel.');
plot(axes('Parent',right),x,sin(x./(max(x)-min(x))*2*pi));
% example from Yair Altman's UISplitPane
figure( ...
'Name', 'uisplitpane demo');
[hDown,hUp,hDiv1] = uisplitpane(gcf,'Orientation','ver','DividerColor',[0,1,0]);
[hLeft,hRight,hDiv2] = uisplitpane(hDown,'DividerColor','r','DividerWidth',3);
t=0:.1:10;
axes('Parent',hUp); plot(t,sin(t));
axes('parent',hLeft); plot(t,cos(t));
axes('parent',hRight); plot(t,tan(t));
hDiv1.DividerLocation = 0.75; % one way to modify divider properties...
set(hDiv2,'DividerColor','red'); % ...and this is another way