
- •Axis control
- •Implicit arguments (similar to handle callbacks):
- •If strcmpi(objTag,'DoNotIgnore')
- •In the units specified by the current figure's Units property, and
- •Graph annotation
- •If you specify a filename, matlab directs output to a file instead of
- •150 For figures in image formats and when
- •In portrait orientation for subsequent print operations.
Implicit arguments (similar to handle callbacks):
function [res] = myfunction(obj,event_obj)
% OBJ handle to the object that has been clicked on.
% EVENT_OBJ handle to event object (empty in this release).
% RES a logical flag to determine whether the zoom
operation should take place or the
'ButtonDownFcn' property of the object should
take precedence.
ActionPreCallback <function_handle>
Set this callback to listen to when a zoom operation will start.
The input function handle should reference a function with two
implicit arguments (similar to handle callbacks):
function myfunction(obj,event_obj)
% OBJ handle to the figure that has been clicked on.
% EVENT_OBJ handle to event object.
The event object has the following read only
property:
Axes The handle of the axes that is being zoomed.
ActionPostCallback <function_handle>
Set this callback to listen to when a zoom operation has finished.
The input function handle should reference a function with two
implicit arguments (similar to handle callbacks):
function myfunction(obj,event_obj)
% OBJ handle to the figure that has been clicked on.
% EVENT_OBJ handle to event object. The object has the same
properties as the EVENT_OBJ of the
'ModePreCallback' callback.
Enable 'on'|{'off'}
Specifies whether this figure mode is currently
enabled on the figure.
FigureHandle <handle>
The associated figure handle. This property supports GET only.
Motion 'horizontal'|'vertical'|{'both'}
The type of zooming for the figure.
Direction {'in'}|'out'
The direction of the zoom operation.
RightClickAction 'InverseZoom'|{'PostContextMenu'}
The behavior of a right-click action. A value of 'InverseZoom'
will cause a right-click to zoom out. A value of 'PostContextMenu'
will display a context menu. This setting will persist between
MATLAB sessions.
UIContextMenu <handle>
Specifies a custom context menu to be displayed during a
right-click action. This property is ignored if the
'RightClickAction' property has been set to 'InverseZoom'.
FLAGS = isAllowAxesZoom(H,AXES)
Calling the function ISALLOWAXESZOOM on the zoom object, H, with a
vector of axes handles, AXES, as input will return a logical array
of the same dimension as the axes handle vector which indicate
whether a zoom operation is permitted on the axes objects.
setAllowAxesZoom(H,AXES,FLAG)
Calling the function SETALLOWAXESZOOM on the zoom object, H, with
a vector of axes handles, AXES, and a logical scalar, FLAG, will
either allow or disallow a zoom operation on the axes objects.
INFO = getAxesZoomMotion(H,AXES)
Calling the function GETAXESZOOMMOTION on the zoom object, H, with
a vector of axes handles, AXES, as input will return a character
cell array of the same dimension as the axes handle vector which
indicates the type of zoom operation for each axes. Possible values
for the type of operation are 'horizontal', 'vertical' or 'both'.
setAxesZoomMotion(H,AXES,STYLE)
Calling the function SETAXESZOOMMOTION on the zoom object, H, with a
vector of axes handles, AXES, and a character array, STYLE, will
set the style of zooming on each axes.
EXAMPLE 1:
plot(1:10);
zoom on
% zoom in on the plot
EXAMPLE 2:
plot(1:10);
h = zoom;
set(h,'Motion','horizontal','Enable','on');
% zoom in on the plot in the horizontal direction.
EXAMPLE 3:
ax1 = subplot(2,2,1);
plot(1:10);
h = zoom;
ax2 = subplot(2,2,2);
plot(rand(3));
setAllowAxesZoom(h,ax2,false);
ax3 = subplot(2,2,3);
plot(peaks);
setAxesZoomMotion(h,ax3,'horizontal');
ax4 = subplot(2,2,4);
contour(peaks);
setAxesZoomMotion(h,ax4,'vertical');
% zoom in on the plots.
EXAMPLE 4: (copy into a file)
function demo
% Allow a line to have its own 'ButtonDownFcn' callback.
hLine = plot(rand(1,10));
set(hLine,'ButtonDownFcn','disp(''This executes'')');
set(hLine,'Tag','DoNotIgnore');
h = zoom;
set(h,'ButtonDownFilter',@mycallback);
set(h,'Enable','on');
% mouse click on the line
function [flag] = mycallback(obj,event_obj)
% If the tag of the object is 'DoNotIgnore', then return true.
objTag = get(obj,'Tag');