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