function y=chgcrd(x,axpos,a2r) %CHGCRD Change coordinates relative<>axis % CHGCRD(x,axpos,a2r) reads a 2D vector x, % the 'Position' property of the current % axis(must be passed as argument), and % the binary quantity a2r (a2r=1 % translates the axis coordinates x to the % corresponding relative figure coorrdinates; % a2r=0 does the reverse). It is a component % of the "fractory.m" program. if a2r y=diag(axpos(3:4))*x'+axpos(1:2)'; else y=diag(1./axpos(3:4))*(x-axpos(1:2))'; end