Mercurial > repos > public > sbplib
annotate savepng.m @ 1031:2ef20d00b386 feature/advectionRV
For easier comparison, return both the first order and residual viscosity when evaluating the residual. Add the first order and residual viscosity to the state of the RungekuttaRV time steppers
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 17 Jan 2019 10:25:06 +0100 |
parents | 236744dda401 |
children |
rev | line source |
---|---|
281
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
1 % TODO |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
2 % Let print size in inches as input parameter |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
3 % Smaller boundingbox |
124 | 4 function savepng(h, filename, dpi) |
143
125c51e4dca8
Added function to set alla font sizes of a figure. Added default dpi to savepng.
Jonatan Werpers <jonatan@werpers.com>
parents:
124
diff
changeset
|
5 default_arg('dpi', 300) |
281
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
6 |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
7 handle_units = h.Units; % Save the current units to be able to restore |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
8 |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
9 % Copy size of figure in centimeters to a place where saveas will honor it |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
10 h.Units = 'centimeters'; |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
11 h.PaperUnits = 'centimeters'; |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
12 h.PaperPosition(3:4) = h.Position(3:4); |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
13 |
124 | 14 print(h,filename,'-dpng',sprintf('-r%d',dpi)); |
281
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
15 |
b4ae78a1c2b9
savepng: Added todo and fixed size bug.
Jonatan Werpers <jonatan@werpers.com>
parents:
143
diff
changeset
|
16 h.Units = handle_units; % Restore the old units |
124 | 17 end |