annotate toolboxes/MIRtoolbox1.3.2/somtoolbox/vis_PlaneAxisProperties.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function vis_PlaneAxisProperties(ax,lattice,msize,pos)
wolffd@0 2
wolffd@0 3 % VIS_PLANEAXISPROPERTIES Set axis properties for SOM_CPLANE,
wolffd@0 4 % SOM_PIEPLANE, SOM_BARPLANE and SOM_PLOTPLANE.
wolffd@0 5 %
wolffd@0 6 % vis_PlaneAxisProperties(ax,lattice,msize,pos)
wolffd@0 7 %
wolffd@0 8 % Input arguments:
wolffd@0 9 % ax (scalar) axis handle
wolffd@0 10 % lattice (string) 'hexa', 'rect', 'hexaU' or 'rectU'
wolffd@0 11 % (matrix) defines the patch, see e.g. help vis_patch
wolffd@0 12 % msize (vector) a 1x2 vector defining the grid size
wolffd@0 13 % pos (vector) a 1x2 vector that determines position of
wolffd@0 14 % origin or NaN which means default operation:
wolffd@0 15 % origin to [1 1] and tighten axis limits
wolffd@0 16 % according to the grid size.
wolffd@0 17 %
wolffd@0 18 % This is a subfunction for SOM_CPLANE, SOM_PIEPLANE, SOM_BARPLANE and
wolffd@0 19 % SOM_PLOTPLANE. This subfunction sets the proper values for axis.
wolffd@0 20
wolffd@0 21 % Copyright (c) 1999-2000 by the SOM toolbox programming team.
wolffd@0 22 % http://www.cis.hut.fi/projects/somtoolbox/
wolffd@0 23
wolffd@0 24 % Version 2.0beta Johan 060799
wolffd@0 25
wolffd@0 26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 27
wolffd@0 28 xdim=msize(1);ydim=msize(2);
wolffd@0 29 set(ax,'Visible','off');
wolffd@0 30 set(get(ax,'Title'),'Visible','on');
wolffd@0 31 set(ax,'XaxisLocation','Top'); % axis orientation
wolffd@0 32 set(ax,'xdir','normal'); % = axis ij = matrix mode
wolffd@0 33 set(ax,'ydir','reverse');
wolffd@0 34
wolffd@0 35 switch lattice
wolffd@0 36 case {'rect', 'rectU'}
wolffd@0 37 lelim=-.51; rilim=.51; uplim=-.51; lolim=.51; % axis limits
wolffd@0 38 set(ax,'DataAspectRatio', [1 1 1]); % =axis equal
wolffd@0 39 case {'hexa','hexaU'}
wolffd@0 40 lelim=-.51; rilim=1.01; uplim=-.67; lolim=.67; % axis limits
wolffd@0 41 set(ax,'DataAspectRatio',[0.9015 1 1]); % this corrects hexagons
wolffd@0 42 end
wolffd@0 43
wolffd@0 44 % Nan: default origin [1 1] & tighten the axis
wolffd@0 45 if isnan(pos)
wolffd@0 46 set(ax,'XLim',[1+lelim ydim+rilim],'YLim',[1+uplim xdim+lolim], ...
wolffd@0 47 'XLimMode','manual','YLimMode','manual'); % tighten the axis
wolffd@0 48 end
wolffd@0 49