📄 doscroll.m
字号:
function theResult = doscroll(self, theEvent, theMessage)% ps/doscroll -- Handler for "ps" scrollbars.% doscroll(self, theEvent, theMessage) pans the axes% in keeping with the active scrollbars, on behalf% of self, a "ps" object. % Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.% All Rights Reserved.% Disclosure without explicit written consent from the% copyright owner does not constitute publication. % Version of 05-Nov-1999 21:34:53.% Updated 05-Nov-1999 21:34:53.if nargout > 0, theResult = []; endif nargin < 1, help(mfilename), return, endtheXLim = get(gca, 'XLim'); % bottom scrollbar.theYLim = get(gca, 'YLim'); % right scrollbar.theZLim = get(gca, 'ZLim'); % left scrollbar.theCLim = get(gca, 'CLim'); % top scrollbar.axis tightset(gca, 'CLimMode', 'auto')theEvent = translate(self, theEvent);switch theEventcase 'bottom' theXLim = get(gca, 'XLim'); smin = get(gcbo, 'Min'); smax = get(gcbo, 'Max'); value = get(gco, 'Value'); frac = value / (smax - smin); theXLim = theXLim + (frac - 0.5)*diff(theXLim);case 'right' theYLim = get(gca, 'YLim'); smin = get(gcbo, 'Min'); smax = get(gcbo, 'Max'); value = get(gco, 'Value'); frac = value / (smax - smin); theYLim = theYLim + (frac - 0.5)*diff(theYLim);case 'left' theZLim = get(gca, 'ZLim'); smin = get(gcbo, 'Min'); smax = get(gcbo, 'Max'); value = get(gco, 'Value'); frac = value / (smax - smin); theZLim = theZLim + (frac - 0.5)*diff(theZLim);case 'top' theCLim = get(gca, 'CLim'); smin = get(gcbo, 'Min'); smax = get(gcbo, 'Max'); value = get(gco, 'Value'); frac = value / (smax - smin); theCLim = theCLim + (frac - 0.5)*diff(theCLim);endset(gca, 'XLim', theXLim, 'YLim', theYLim, 'ZLim', theZLim, 'CLim', theCLim)if nargout > 0 theResult = self;else assignin('caller', 'ans', self)end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -