wolffd@0: function vis_PlaneAxisProperties(ax,lattice,msize,pos) wolffd@0: wolffd@0: % VIS_PLANEAXISPROPERTIES Set axis properties for SOM_CPLANE, wolffd@0: % SOM_PIEPLANE, SOM_BARPLANE and SOM_PLOTPLANE. wolffd@0: % wolffd@0: % vis_PlaneAxisProperties(ax,lattice,msize,pos) wolffd@0: % wolffd@0: % Input arguments: wolffd@0: % ax (scalar) axis handle wolffd@0: % lattice (string) 'hexa', 'rect', 'hexaU' or 'rectU' wolffd@0: % (matrix) defines the patch, see e.g. help vis_patch wolffd@0: % msize (vector) a 1x2 vector defining the grid size wolffd@0: % pos (vector) a 1x2 vector that determines position of wolffd@0: % origin or NaN which means default operation: wolffd@0: % origin to [1 1] and tighten axis limits wolffd@0: % according to the grid size. wolffd@0: % wolffd@0: % This is a subfunction for SOM_CPLANE, SOM_PIEPLANE, SOM_BARPLANE and wolffd@0: % SOM_PLOTPLANE. This subfunction sets the proper values for axis. wolffd@0: wolffd@0: % Copyright (c) 1999-2000 by the SOM toolbox programming team. wolffd@0: % http://www.cis.hut.fi/projects/somtoolbox/ wolffd@0: wolffd@0: % Version 2.0beta Johan 060799 wolffd@0: wolffd@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wolffd@0: wolffd@0: xdim=msize(1);ydim=msize(2); wolffd@0: set(ax,'Visible','off'); wolffd@0: set(get(ax,'Title'),'Visible','on'); wolffd@0: set(ax,'XaxisLocation','Top'); % axis orientation wolffd@0: set(ax,'xdir','normal'); % = axis ij = matrix mode wolffd@0: set(ax,'ydir','reverse'); wolffd@0: wolffd@0: switch lattice wolffd@0: case {'rect', 'rectU'} wolffd@0: lelim=-.51; rilim=.51; uplim=-.51; lolim=.51; % axis limits wolffd@0: set(ax,'DataAspectRatio', [1 1 1]); % =axis equal wolffd@0: case {'hexa','hexaU'} wolffd@0: lelim=-.51; rilim=1.01; uplim=-.67; lolim=.67; % axis limits wolffd@0: set(ax,'DataAspectRatio',[0.9015 1 1]); % this corrects hexagons wolffd@0: end wolffd@0: wolffd@0: % Nan: default origin [1 1] & tighten the axis wolffd@0: if isnan(pos) wolffd@0: set(ax,'XLim',[1+lelim ydim+rilim],'YLim',[1+uplim xdim+lolim], ... wolffd@0: 'XLimMode','manual','YLimMode','manual'); % tighten the axis wolffd@0: end wolffd@0: