fh = figure();
axisPanel = uipanel(fh, 'Position', [0 0 0.5 1], 'BackgroundColor', [1 1 1]);
leftAxis = axes(axisPanel, 'Position', [0.1 0.1 0.8 0.8]);
buttonPanel = uipanel(fh, 'Position', [0.5 0 0.5 1], 'BackgroundColor', [0.7 0.7 0.7]);
rightAxis = axes(buttonPanel, 'Position', [0.1 .3 0.8 0.6]);
leftPlotButton = uicontrol(buttonPanel, 'Style', 'pushbutton', ...
'String', 'Plot Left', 'Units', 'normalized', 'Position', [0.1 0 0.3 0.1], ...
'Callback', @(src, event) buttonPressCallback(leftAxis));
rightPlotButton = uicontrol(buttonPanel, 'Style', 'pushbutton', ...
'String', 'Plot Right', 'Units', 'normalized', 'Position', [0.6 0 0.3 0.1], ...
'Callback', @(src, event) buttonPressCallback(rightAxis));
function buttonPressCallback(thisAxis)
plot(thisAxis, rand(1, 10), rand(1, 10), 'r.');
end
0 Comments
Sign in to comment.