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

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