Mercurial > repos > public > sbplib
changeset 135:8979d81515ac
Added a function for printing the axes positions of a subplot grid.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 08 Feb 2016 17:52:23 +0100 |
parents | 08d7bb7c8ac4 |
children | 8298734b1938 |
files | axPos.m |
diffstat | 1 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r 08d7bb7c8ac4 -r 8979d81515ac axPos.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/axPos.m Mon Feb 08 17:52:23 2016 +0100 @@ -0,0 +1,26 @@ +function axPos(n,m) + a = {}; + aPos = []; + for i = 1:n*m + a{i} = subplot(n, m, i); + aPos(i,:) = a{i}.Position; + end + + dx = aPos(1,3); + dy = aPos(1,4); + + x = unique(aPos(:,1)); + y = unique(aPos(:,2)); + + + fprintf('dx: %f\n', dx); + fprintf('dy: %f\n', dy); + + fprintf(' x: '); + fprintf('%f ', x); + fprintf('\n'); + + fprintf(' y: '); + fprintf('%f ', y); + fprintf('\n'); +end