tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function back=mysubplot(nr_y,nr_x,nr,rect, hint) tomwalters@0: % usage: mysubplot(nr_y,nr_x,nr,rect, hint)) tomwalters@0: % exact like subplot, but can draw into arbitrary figures tomwalters@0: % the rect in which the new axis are plottet are given by rect. tomwalters@0: % if rect is not given, 0 0 1 1 is taken tomwalters@0: % rect is (x_min,y_min,x_width,y_width) tomwalters@0: % hint gives additionally information about spaces in the graphic tomwalters@0: % hint=0: normal with spaces everywere (every figure has its own axis) tomwalters@0: % hint=1: Space only at the bottom and on the left. of the outer pictures. There are the titles tomwalters@0: tomwalters@0: spacing=0.05; tomwalters@0: tomwalters@0: if nargin < 4 tomwalters@0: rect=[0 0 1 1]; tomwalters@0: end tomwalters@0: tomwalters@0: if nargin < 5 tomwalters@0: hint=0; tomwalters@0: end tomwalters@0: tomwalters@0: rectleft=rect(1); tomwalters@0: rectbottom=rect(2); tomwalters@0: rectwidth=rect(3); tomwalters@0: rectheight=rect(4); tomwalters@0: tomwalters@0: tomwalters@0: if hint==0 tomwalters@0: distleft=rectwidth*spacing; % der Abstand, der vom Rand eingehalten werden soll tomwalters@0: distright=rectwidth*spacing; tomwalters@0: disthochzwischen=rectheight*spacing; % Abstand zwischen zwei vertikalen Bildern tomwalters@0: distbreitzwischen=rectwidth*spacing; % Abstand zwischen zwei vertikalen Bildern tomwalters@0: distunten=rectwidth*spacing; % Abstand nach unten tomwalters@0: end tomwalters@0: if hint==1 tomwalters@0: distleft=rectwidth*spacing; % der Abstand, der vom Rand eingehalten werden soll tomwalters@0: distright=0; tomwalters@0: disthochzwischen=rectheight*0.01; % Abstand zwischen zwei vertikalen Bildern tomwalters@0: distbreitzwischen=0; % Abstand zwischen zwei vertikalen Bildern tomwalters@0: distunten=rectwidth*spacing; % Abstand nach unten tomwalters@0: end tomwalters@0: tomwalters@0: if hint==0 tomwalters@0: x=rectwidth/nr_x; tomwalters@0: y=rectheight/nr_y; tomwalters@0: tomwalters@0: nnx=mod(nr-1,nr_x); tomwalters@0: ges=nr_x*nr_y; tomwalters@0: nny=ges/nr_x - round((nr-1)/nr_x+0.5); tomwalters@0: tomwalters@0: left=distleft+x*nnx; tomwalters@0: bottom=distunten+y*nny; tomwalters@0: width=x-distleft-distright; tomwalters@0: height=y-distunten-disthochzwischen; tomwalters@0: end tomwalters@0: if hint==1 tomwalters@0: x=(rectwidth-distleft)/nr_x; tomwalters@0: y=(rectheight-distunten)/nr_y; tomwalters@0: tomwalters@0: nnx=mod(nr-1,nr_x); tomwalters@0: ges=nr_x*nr_y; tomwalters@0: nny=ges/nr_x - round((nr-1)/nr_x+0.5); tomwalters@0: tomwalters@0: left=distleft+x*nnx; tomwalters@0: bottom=distunten+y*nny; tomwalters@0: width=x-distbreitzwischen; tomwalters@0: height=y-disthochzwischen; tomwalters@0: end tomwalters@0: tomwalters@0: back=[rectleft+left rectbottom+bottom width height]; tomwalters@0: tomwalters@0: axes('position',back);