📄 scaling.m
字号:
%SCALING SCALING allows to change the scaling and the colormap of a figure
%
%Inputs:
%Outputs:
%
%Authors: Achim Wacker (AWa) NTC
%
%Revision: 5.0.0cd Date: 17-Jul-2001
%
%needed m-files: none
function fig = scaling();
testud = get(gca, 'userdata');
testud.curAxis = gca;
colMaps = str2mat('hsv', 'hot', 'gray', 'bone', 'copper', 'pink', 'white', 'flag', ...
'lines', 'colorcube', 'jet', 'prism', 'cool', 'autumn', 'spring', ...
'winter', 'summer');
mapInd = strmatch(testud.curColMap, colMaps);
h0 = dialog('Color', [0.8 0.8 0.8], ...
'PaperType', 'A4', ...
'Name', 'scaling', ...
'NumberTitle', 'off', ...
'Position', [640 337 267 285], ...
'WindowStyle', 'Modal', ...
'Tag', 'Fig2', ...
'userdata', testud);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.8 0.8 0.8], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [27 227.5 105 17], ...
'String', 'minimum value:', ...
'Style', 'text', ...
'Tag', 'StaticText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.8 0.8 0.8], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [30 183.5 102 17], ...
'String', 'maximum value:', ...
'Style', 'text', ...
'Tag', 'StaticText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'ListboxTop', 0, ...
'Position', [168 222 63 28], ...
'Callback', 'testud = get(gcf, ''userdata'');testud.minValue = str2num(get(gcbo, ''String''));set(gcf, ''userdata'', testud);', ...
'String', num2str(testud.minValue), ...
'Style', 'edit', ...
'Tag', 'EditText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'ListboxTop', 0, ...
'Callback', 'colMaps = get(gcbo, ''String''); testud = get(gcf, ''userdata'');testud.curColMap = colMaps(get(gcbo, ''Value''), :);set(gcf, ''userdata'', testud);', ...
'UserData', colMaps, ...
'Units', 'Pixels', ...
'Position', [106 61 125 30], ...
'String', colMaps, ...
'Style', 'popupmenu', ...
'Tag', 'PopupMenu1', ...
'Value', mapInd);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.8 0.8 0.8], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [25 69 60 17], ...
'String', 'colormap:', ...
'Style', 'text', ...
'Tag', 'StaticText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'ListboxTop', 0, ...
'Position', [168 178 63 28], ...
'Callback', 'testud = get(gcf, ''userdata'');testud.maxValue = str2num(get(gcbo, ''String''));set(gcf, ''userdata'', testud);', ...
'String', num2str(testud.maxValue), ...
'Style', 'edit', ...
'Tag', 'EditText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'ListboxTop', 0, ...
'Position', [168 133 63 28], ...
'Callback', 'testud = get(gcf, ''userdata'');testud.stepSize = str2num(get(gcbo, ''String''));set(gcf, ''userdata'', testud);', ...
'String', num2str(testud.stepSize), ...
'Style', 'edit', ...
'Tag', 'EditText1');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.8 0.8 0.8], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [30 138.5 102 17], ...
'String', 'step size:', ...
'Style', 'text', ...
'Tag', 'StaticText1');
h1 = uicontrol('Parent', h0, ...
'Units', 'Pixels', ...
'Callback', 'testud = get(gcf, ''userdata'');set(testud.curAxis, ''userdata'', testud);close(gcf);eval(testud.curFun);', ...
'ListboxTop', 0, ...
'Position', [110 20 67 30], ...
'String', 'OK', ...
'Tag', 'PushbuttonOK');
if nargout > 0, fig = h0; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -