Thursday, 15 July 2010

matlab - Overlay data on image file aligning with grid lines -



matlab - Overlay data on image file aligning with grid lines -

my aim plot image file in matlab , aligning closely ticks image overlay info points. image file screen captured pdf study (link below). info loglog. image file axis has lower , upper bounds of.

xstart 1e-2 xend 1e5 % frequency , ystart 1e-7 yo yend 1e-1 % amplitude

i plot next info values on top of image

frequency = [1 3 10 30 100 300 1000 3000 10000]; amplitude = [7e-3 8e-4 1.3e-4 4e-5 2e-5 1.8e-5 1.7e-5 1.65e-5 1.6e-5];

(or vector values computation illustration vector "b" function of frequency vector "f")

the issue have .pdf image has grid lines. consequence misaligning info points , making unaesthetic axis labels.thanks

image file

i think it's best align log ticks closely possible image file. below code. haven't worked out how align tick axis image yet (when zoomed in), (i'm sure can manually, if there elegant image process mathematical method nice).

imginputlf = imread('rmit_input_noise_lowf.png'); [nrows,ncols,dim]=size(imginputlf); figure(1) f = logspace(-2,5,ncols); amp=logspace(-7,-1,nrows); xrng=[min(f) max(f)];yrng=[min(amp) max(amp)]; imagesc(xrng,yrng,imginputlf) ax1=gca; set(ax1,'yticklabel', [], 'xticklabel', []) % remove pixel ticklabels set(findobj(gcf, 'type','axes'), 'visible','off') freq = [1 3 10 30 100 300 1000 3000 10000]; % info amp = [7e-3 8e-4 1.3e-4 4e-5 2e-5 1.8e-5 1.7e-5 1.65e-5 1.6e-5]; %data ax2 = axes('position',get(ax1,'position'),'color','none','yscale', 'log','xscale','log'); %color=none create image visible ylim(yrng) xlim(xrng) hold on loglog(freq,amp,'k','linewidth',4) % plot info end

image matlab alignment overlay axis

No comments:

Post a Comment