📄 plot_subspaces.m
字号:
% The main function for plotting subspaces generated by the GPCA algorithm.% You may also wish to call plot_data(data, labels) to superimpose the data% itself.% Example: plot_subspaces(data, labels, groupBases, basisDimensions)%% Can handle two or three dimensional data.%% Can also display a set of normal vectors on the same graph. Not all% normal vectors need to be computed; the number to be displayed must be% specified. Normal vectors will be rendered in order they are passed.%function pl = plot_subspaces(data, labels, groupBases, basisDimensions, varargin)% Hold while drawing a bunch of elements to the current figure.originalHoldState = ishold;hold on;if size(data,1) == 2, pl = plot_subspaces2(data, labels, groupBases, basisDimensions, varargin{:}); % Set the plot to the default 2D view. view(2); % Turn on the grid so it is easier to tell where the origin is. grid on; elseif size(data,1) == 3, pl = plot_subspaces3(data, labels, groupBases, basisDimensions, varargin{:}); % Set the plot to the default 3D view. view(3); % Set the camera projection type.% camproj('perspective'); camproj('orthographic'); axis vis3d; % Lock the aspect ratios for rotating with the mouse.elseif size(data,1) == 4, pl = plot_subspaces4(data, labels, groupBases, basisDimensions, varargin{:}); % Set the plot to the default 3D view. view(3); % Set the camera projection type.% camproj('perspective'); camproj('orthographic'); axis vis3d; % Lock the aspect ratios for rotating with the mouse.else error('plot_subspaces can only handle data of dimension 2,3 or 4.');end% Restore original hold stateif ~originalHoldState, hold off;end% Resize the figure window so that it is more readily visible.set(0,'Units','pixels');temp = (get(0,'ScreenSize'));screenColumns = temp(3);screenRows = temp(4);figureFillRatio = [.8 .5]; % Fraction of the columns and rows to fill up.screenCenter = floor([screenColumns/2 screenRows/2]);cornerOffset = floor([screenColumns*figureFillRatio(1)/2 screenColumns*figureFillRatio(2)/2]);set(gcf,'Position',[screenCenter - cornerOffset, 2*cornerOffset]);%set(gcf,'MenuBar','none')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -