Mercurial > repos > public > sbplib
annotate axPos.m @ 1037:2d7ba44340d0 feature/burgers1d
Pass scheme specific parameters as cell array. This will enabale constructDiffOps to be more general. In addition, allow for schemes returning function handles as diffOps, which is currently how non-linear schemes such as Burgers1d are implemented.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 18 Jan 2019 09:02:02 +0100 |
parents | 8979d81515ac |
children |
rev | line source |
---|---|
135
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 function axPos(n,m) |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 a = {}; |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 aPos = []; |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 for i = 1:n*m |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 a{i} = subplot(n, m, i); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 aPos(i,:) = a{i}.Position; |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 end |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
9 dx = aPos(1,3); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
10 dy = aPos(1,4); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
11 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
12 x = unique(aPos(:,1)); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
13 y = unique(aPos(:,2)); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
14 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
15 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
16 fprintf('dx: %f\n', dx); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
17 fprintf('dy: %f\n', dy); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
18 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
19 fprintf(' x: '); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
20 fprintf('%f ', x); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
21 fprintf('\n'); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
22 |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
23 fprintf(' y: '); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
24 fprintf('%f ', y); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
25 fprintf('\n'); |
8979d81515ac
Added a function for printing the axes positions of a subplot grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
26 end |