Enlarge matlab axis by a specific factor

Alec Jacobson

April 08, 2014

weblog/

Here's the code I use to double or enlarge the axis of a plot window by any factor. Say 150%:

a = axis;
axis(a+1.5*[a(1:2)-(a(1)+a(2))*0.5 a(3:4)-(a(3)+a(4))*0.5]);