⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gd_plotfunction.m

📁 一个Matlab写的关于图理论以及其在机器学习中应用的教学用GUI软件
💻 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 + -