function logy2raw(base,precision, fontsize) %logy2raw([base],[precision]) % %Converts X-axis labels from log to raw values. %base: base of log transform; default base is e. %precision: number of decimal places; default is two. % %Example: % x=linspace(-3,0,11); % plot(log(x),log(x.^2)); % logx2raw % logy2raw %SEE ALSO; Logy2raw %11/17/96 gmb Wrote it. %6/6/96 gmb added precision argument %01/30/02 gmb updated it to use cell arrays, and to use original % xtick values instead of converting labels. This way, % multiple calls to this function doesn't keep converting % the axis. if nargin==0 base=exp(1); end if nargin<2 precision=2; end if nargin<3 fontsize=12; end qt=''''; origYTick = get(gca,'YTick'); newYTick = base.^(origYTick); for i=1:length(newYTick) estr=(['newYLabel{i}=num2str(sprintf(',qt,'%',sprintf('%2.1f',precision*1.1), ... 'f',qt,',newYTick(i)));']); eval(estr) end set(gca,'YTickLabel',newYLabel, 'FontName', 'Arial', 'FontSize', fontsize);