comparison scaleAxisLim.m @ 373:0976e579a6f0

Add functions for scaling figure windows and axes.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 25 Jan 2017 16:21:14 +0100
parents
children
comparison
equal deleted inserted replaced
358:5cb99f56f55e 373:0976e579a6f0
1 function scaleAxisLim(ah, s)
2 x = ah.XLim;
3 y = ah.YLim;
4
5 xl = x(2) - x(1);
6 yl = y(2) - y(1);
7
8 dx = xl*(s-1);
9 dy = yl*(s-1);
10
11 ah.XLim = x + [-dx/2 dx/2];
12 ah.YLim = y + [-dy/2 dy/2];
13 end