From: Jose on
Hello to everyone, I find a nice way to plot in a table my vectors:

x=[0.25 0.5 0.75 1.00]

y=[0.25 0.5 0.75 1.00]

z= [27 95 74 37; 89 35 55 40; 79 72 30 39; 43 46 41 3]

I did it with:

h=imagesc(x,y,z)...but my problem is that i need to put tick marks at 0.25 0.5 0.75 and 1, i.e at the middle of every square,
because by default it is as: 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1...any help?

Thanks in advance.
From: us on
"Jose " <jose.l.vega(a)gmail.com> wrote in message <hsrv94$e7m$1(a)fred.mathworks.com>...
> Hello to everyone, I find a nice way to plot in a table my vectors:
>
> x=[0.25 0.5 0.75 1.00]
>
> y=[0.25 0.5 0.75 1.00]
>
> z= [27 95 74 37; 89 35 55 40; 79 72 30 39; 43 46 41 3]
>
> I did it with:
>
> h=imagesc(x,y,z)...but my problem is that i need to put tick marks at 0.25 0.5 0.75 and 1, i.e at the middle of every square,
> because by default it is as: 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1...any help?
>
> Thanks in advance.

one of the solutions

% do your IMAGESC(...)
set(gca,'xtick',.25:.25:1); % <- same for ytick...

us
From: Walter Roberson on
Jose wrote:
> Hello to everyone, I find a nice way to plot in a table my vectors:
>
> x=[0.25 0.5 0.75 1.00]
>
> y=[0.25 0.5 0.75 1.00]
>
> z= [27 95 74 37; 89 35 55 40; 79 72 30 39; 43 46 41 3]
>
> I did it with:
>
> h=imagesc(x,y,z)...but my problem is that i need to put tick marks at
> 0.25 0.5 0.75 and 1, i.e at the middle of every square,
> because by default it is as: 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
> 1.1...any help?

set(ancestor(h,'axis'), 'XTick', x, 'YTick', y]);