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:
Strange thing: double tickmarks on my colorbar!!!

Subject: Strange thing: double tickmarks on my colorbar!!!

From: Camille Couzi

Date: 30 Aug, 2010 16:26:19

Message: 1 of 5

Hi matlabers!

I am having some strange behavior on my GUI: I am displaying many matrix (with same size) on a same axes with the imagesc function. I have created a colorbar, and by default the tickmarsk are placed at the right of the colorbar.

The strange thing is that when I open my GUI, and ask a matrix, it displays the colorbar ok, but then when I ask another matrix, the same tickmark appear on the leftside of the colorbar!!! and after calling many other matrix it seems to over write the tickmarks...
Have someone an idea? It happened after I resized the figure, and I think it is because of I let to the colorbar a little space... perhaps I am wrong. I didn't find anything about that problem on the web.

Thanks in advance...
Camille.

Subject: Strange thing: double tickmarks on my colorbar!!!

From: Grzegorz Knor

Date: 30 Aug, 2010 18:40:09

Message: 2 of 5

"Camille Couzi" <camillecouzi@yahoo.fr> wrote in message <i5gm3b$7dm$1@fred.mathworks.com>...
> Hi matlabers!
>
> I am having some strange behavior on my GUI: I am displaying many matrix (with same size) on a same axes with the imagesc function. I have created a colorbar, and by default the tickmarsk are placed at the right of the colorbar.
>
> The strange thing is that when I open my GUI, and ask a matrix, it displays the colorbar ok, but then when I ask another matrix, the same tickmark appear on the leftside of the colorbar!!! and after calling many other matrix it seems to over write the tickmarks...
> Have someone an idea? It happened after I resized the figure, and I think it is because of I let to the colorbar a little space... perhaps I am wrong. I didn't find anything about that problem on the web.
>
> Thanks in advance...
> Camille.

Try call the function AXES before IMAGESC command with argument h which is handle to axis.

Look at this code (with error)
load clown
imagesc(X)
h = colorbar
axes(h)
imagesc(X)

Maybe you are doing something similiar?

Subject: Strange thing: double tickmarks on my colorbar!!!

From: Camille Couzi

Date: 30 Aug, 2010 20:13:06

Message: 3 of 5

"Grzegorz Knor" <gknor@o2.pl> wrote in message <i5gtu9$msl$1@fred.mathworks.com>...
> "Camille Couzi" <camillecouzi@yahoo.fr> wrote in message <i5gm3b$7dm$1@fred.mathworks.com>...
> > Hi matlabers!
> >
> > I am having some strange behavior on my GUI: I am displaying many matrix (with same size) on a same axes with the imagesc function. I have created a colorbar, and by default the tickmarsk are placed at the right of the colorbar.
> >
> > The strange thing is that when I open my GUI, and ask a matrix, it displays the colorbar ok, but then when I ask another matrix, the same tickmark appear on the leftside of the colorbar!!! and after calling many other matrix it seems to over write the tickmarks...
> > Have someone an idea? It happened after I resized the figure, and I think it is because of I let to the colorbar a little space... perhaps I am wrong. I didn't find anything about that problem on the web.
> >
> > Thanks in advance...
> > Camille.
>

Hi Grzegorz
Yes, this is what I am doing, I call axes(h) before imagesc(matrix). What is the right way to do it?
Thanks
Camille
> Try call the function AXES before IMAGESC command with argument h which is handle to axis.
>
> Look at this code (with error)
> load clown
> imagesc(X)
> h = colorbar
> axes(h)
> imagesc(X)
>
> Maybe you are doing something similiar?

Subject: Strange thing: double tickmarks on my colorbar!!!

From: Grzegorz Knor

Date: 30 Aug, 2010 20:23:06

Message: 4 of 5

Can you show a fragment of your code?

Subject: Strange thing: double tickmarks on my colorbar!!!

From: Camille Couzi

Date: 4 Nov, 2010 13:34:04

Message: 5 of 5

"Grzegorz Knor" <gknor@o2.pl> wrote in message <i5h3va$p60$1@fred.mathworks.com>...
> Can you show a fragment of your code?



Hi Grzegorz,
Sorry for answer so late, I have had other priorities in my job and now I am returning to my program. I have begun creating a very simple GUI as mine in order to copy and paste here, but after many tries, I have found the problem of the double tick marks: it is because of the replacechildren option in nextplot:
In fact, I need that option in order to keep the same zoom on axis when changing from one matrix to another, while displaying them on the imagesc. when I desactivate that option, colorbar works ok with only one tick mark on the right of the colorbar, but when I set(axe1,'nextplot','replacechildren'); on, then problem begun...

How can I solve that?
Thanks a lot for your help

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