|
"Bruno Luong" <brunoluong@yahoo.com> wrote in message
<fifklg$p53$1@fred.mathworks.com>...
> "David " <djones.nospam@remove.mcmaster.ca> wrote in message
> <fifjdf$5s6$1@fred.mathworks.com>...
>
> x=linspace(0,10,1000); % 0 to 10 s, 1000 samples
> y=logspace(1,3,1000); % 10^1 to 10^3, 1000 samples
> imagesc(x,y,data);
> set(gca,'Yscale','log','Ydir','normal');
>
> Bruno
>
Thanks, ... that *ALMOST* solves my problem,
but there is an error when I try this.
The Y axis labels are not positioned properly.
There seems to be a problem with the "YLim" axis property.
Presumably it is still linear, while the labels are log.
Any suggestions?
I don't know how to update "YLim" appropriately.
You can see for yourself:
N = 32;
data = rand(N,N);
x=linspace(0,10,N); % 0 to 10 s, 64 samples
A = log10(5);
B = log10(60);
y=logspace(A,B,N); % 10^A to 10^B, 64 samples
imagesc(x,y,data);
set(gca,'Yscale','log','Ydir','normal', 'YTick', [5 10 20 30
40 50 60]);
xlabel('Time (sec)'); ylabel('Frequency (Hz)');
|