Got Questions? Get Answers.
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:
colorbar: E-2 to 0.01

Subject: colorbar: E-2 to 0.01

From: Avri Alony

Date: 16 Jun, 2011 06:15:49

Message: 1 of 5

All the values in the colorbar appear as 2E-2, 3E-2, etc
How can I change the YTick label in the colorbar from E-2 to 0.01 by
script (not manual)
Thanks

Subject: colorbar: E-2 to 0.01

From: Krishna Kumar

Date: 16 Jun, 2011 06:42:02

Message: 2 of 5

Avri Alony <avrialony@gmail.com> wrote in message <35b46ae2-73dc-4963-aa3b-5d6540486c0a@e16g2000vbq.googlegroups.com>...
> All the values in the colorbar appear as 2E-2, 3E-2, etc
> How can I change the YTick label in the colorbar from E-2 to 0.01 by
> script (not manual)
> Thanks
Hi,
try using set function and change 'YTicklabel' property. Refer doc set.
hth
Krishna

Subject: colorbar: E-2 to 0.01

From: Avri Alony

Date: 16 Jun, 2011 07:19:10

Message: 3 of 5

On Jun 16, 9:42 am, "Krishna Kumar" <skrishnakumar.ac...@gmail.com>
wrote:
> Avri Alony <avrial...@gmail.com> wrote in message <35b46ae2-73dc-4963-aa3b-5d6540486...@e16g2000vbq.googlegroups.com>...
> > All the values in the colorbar  appear as 2E-2, 3E-2, etc
> > How can I change the YTick label in the colorbar from E-2 to 0.01 by
> > script (not manual)
> > Thanks
>
> Hi,
> try using set function and change 'YTicklabel' property. Refer doc set.
> hth
> Krishna

I do use YTicklabel but I dont know how to eliminate the (10^-3) and
set instead decimal numbers

Subject: colorbar: E-2 to 0.01

From: Avri Alony

Date: 16 Jun, 2011 08:07:41

Message: 4 of 5

On Jun 16, 10:19 am, Avri Alony <avrial...@gmail.com> wrote:
> On Jun 16, 9:42 am, "Krishna Kumar" <skrishnakumar.ac...@gmail.com>
> wrote:
>
> > Avri Alony <avrial...@gmail.com> wrote in message <35b46ae2-73dc-4963-aa3b-5d6540486...@e16g2000vbq.googlegroups.com>...
> > > All the values in the colorbar  appear as 2E-2, 3E-2, etc
> > > How can I change the YTick label in the colorbar from E-2 to 0.01 by
> > > script (not manual)
> > > Thanks
>
> > Hi,
> > try using set function and change 'YTicklabel' property. Refer doc set.
> > hth
> > Krishna
>
> I do use YTicklabel but I dont know how to eliminate the (10^-3) and
> set instead  decimal numbers

I success;

C = get(gcf,'children');
CB = get(C(1));
strYTick = num2str(CB.YTick');
set(C(1),'YTickLabel',strYTick)

Subject: colorbar: E-2 to 0.01

From: Krishna Kumar

Date: 16 Jun, 2011 08:11:02

Message: 5 of 5

Avri Alony <avrialony@gmail.com> wrote in message <043cddee-945f-4962-b998-7217dd5772a3@c26g2000vbq.googlegroups.com>...
> On Jun 16, 9:42 am, "Krishna Kumar" <skrishnakumar.ac...@gmail.com>
> wrote:
> > Avri Alony <avrial...@gmail.com> wrote in message <35b46ae2-73dc-4963-aa3b-5d6540486...@e16g2000vbq.googlegroups.com>...
> > > All the values in the colorbar  appear as 2E-2, 3E-2, etc
> > > How can I change the YTick label in the colorbar from E-2 to 0.01 by
> > > script (not manual)
> > > Thanks
> >
> > Hi,
> > try using set function and change 'YTicklabel' property. Refer doc set.
> > hth
> > Krishna
>
> I do use YTicklabel but I dont know how to eliminate the (10^-3) and
> set instead decimal numbers
Hi,
 Are using correct handle in set function call while editing the tick labels?
If not get the handle for colorbar and call set(colorbar's handle, 'YTickla....
hth,
Krishna

Tags for this Thread

No tags are associated with 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