Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Change the axis in imagesc

Subject: Change the axis in imagesc

From: Jose

Date: 17 May, 2010 17:44:04

Message: 1 of 4

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.

Subject: Change the axis in imagesc

From: us

Date: 17 May, 2010 18:03:05

Message: 2 of 4

"Jose " <jose.l.vega@gmail.com> wrote in message <hsrv94$e7m$1@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

Subject: Change the axis in imagesc

From: Walter Roberson

Date: 17 May, 2010 18:13:28

Message: 3 of 4

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]);

Subject: Change the axis in imagesc

From: Camille Couzi

Date: 20 Aug, 2010 16:47:05

Message: 4 of 4

Walter Roberson <roberson@hushmail.com> wrote in message <hss117$na4$3@canopus.cc.umanitoba.ca>...
> 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 begin_of_the_skype_highlighting              27 95 74 37      end_of_the_skype_highlighting; 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]);


Hi Jose,
Did you finally found a solution for this problem?
I am having the same sort of thing to solve...
thanks

Camille,.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us