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