Mercurial > repos > public > sbplib
comparison axPos.m @ 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 | |
children |
comparison
equal
deleted
inserted
replaced
134:08d7bb7c8ac4 | 135:8979d81515ac |
---|---|
1 function axPos(n,m) | |
2 a = {}; | |
3 aPos = []; | |
4 for i = 1:n*m | |
5 a{i} = subplot(n, m, i); | |
6 aPos(i,:) = a{i}.Position; | |
7 end | |
8 | |
9 dx = aPos(1,3); | |
10 dy = aPos(1,4); | |
11 | |
12 x = unique(aPos(:,1)); | |
13 y = unique(aPos(:,2)); | |
14 | |
15 | |
16 fprintf('dx: %f\n', dx); | |
17 fprintf('dy: %f\n', dy); | |
18 | |
19 fprintf(' x: '); | |
20 fprintf('%f ', x); | |
21 fprintf('\n'); | |
22 | |
23 fprintf(' y: '); | |
24 fprintf('%f ', y); | |
25 fprintf('\n'); | |
26 end |