Mercurial > repos > public > sbplib
annotate savepng.m @ 774:66eb4a2bbb72 feature/grids
Remove default scaling of the system.
The scaling doens't seem to help actual solutions. One example that fails in the flexural code.
With large timesteps the solutions seems to blow up. One particular example is profilePresentation
on the tdb_presentation_figures branch with k = 0.0005
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 18 Jul 2018 15:42:52 -0700 |
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 |