📄 gd_plotfunction.m
字号:
function GD_PlotFunction(handle,points,f, titlestring, rangemin, rangemax)% Usage: GD_PlotFunction(handle,points,f, titlestring, rangemin, rangemax)% % Input: handle of the axis to plot into% points: matrix, size (num_points, 2)% f: vector, size (n,1); function values to plot% titlestring: the string to put in the title of the figures% rangemin and rangemax: min and max range to be used in the colorbar. % the last two arguments are optional. can be used to let several % plots have the same colorrange. if (nargin == 4) %no range was specified rangemin = min(f); rangemax = max(f); end% rescale and shift to fit to colormap:f = f - rangemin; % make non-negif(isequal(rangemin, rangemax)) warning('plot_function: all function values are the same, reset them to 1 for plotting') f = ones(size(f));else f = f ./ (rangemax - rangemin) * 60; % rescaleend% plot it:colors = colormap; scatter(handle,points(:,1),points(:,2),20,colors(floor(f)+1,:),'filled');title(handle,titlestring);axis(handle,'equal');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -