|
"Rebecca " <rebecca.shuang@gmail.com> wrote in message <jrlodr$ckr$1@newscl01ah.mathworks.com>...
> I need to plot an image, "apple" for example, that both x and y are in log axis.
>
> x = 10.^linspace(log10(0.1),log10(3),10);
> y = 10.^linspace(log10(1),log10(5),8);
> apple = (y'*x/10);
> imagesc(x,y,apple)
> set(gca,'YScale','log','YMinorTick','on','Ydir','normal')
> axis tight
> set(gca,'XTick',([0.1,0.3, 1,3]))
> set(gca,'YTick',([1 1.5 1.8 2.1 5]))
>
> % lines below won't work
> set(gca,'XScale','log')
> set(gca,'XMinorTick','on')
> set(gca,'YScale','log')
> set(gca,'YMinorTick','on')
IMAGE and IMAGESC can't plot a irregular spaced pixel.
You can merely change the ticklabel.
Use patch or surf to plot irregular spaced data
z=peaks(40);
surf(1:40,1:40,zeros(size(z)),'CData',z, 'Linestyle','none')
view(0,90)
set(gca,'yscale','log')
% Bruno
|