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:
Add unit of colorbar

Subject: Add unit of colorbar

From: edward kabanyas

Date: 13 Jul, 2011 01:34:27

Message: 1 of 3

Hi All,

I would like to add the unit of colorbar. My code is:

hc=colorbar;
xlabel(hc,'m/s') ,

However, the unit occurs at the bottom of colorbar, it is common to put the unit at its top. Any idea ?

Second, if I put the colorbar in the other location such as:
colorbar('location','southoutside')
How to put the unit at the right end of the colorbar ?

Thanks for help

Edward

Subject: Add unit of colorbar

From: ImageAnalyst

Date: 13 Jul, 2011 01:58:07

Message: 2 of 3

On Jul 12, 9:34 pm, "edward kabanyas" <djuky_...@yahoo.com> wrote:
> Hi All,
>
> I would like to add the unit of colorbar. My code is:
>
> hc=colorbar;
> xlabel(hc,'m/s') ,
>
> However, the unit occurs at the bottom of colorbar, it is common to put the unit at its top. Any idea ?
>
> Second, if I put the colorbar in the other location such as:
> colorbar('location','southoutside')
> How to put the unit at the right end of the colorbar ?
>
> Thanks for help
>
> Edward

---------------------------------------------
Edward:
Did you see the example in the help?

surf(peaks(30))
colorbar('YTickLabel',...
    {'Freezing','Cold','Cool','Neutral',...
     'Warm','Hot','Burning','Nuclear'})

It puts labels on the right side of the colorbar.

Subject: Add unit of colorbar

From: edward kabanyas

Date: 13 Jul, 2011 02:24:25

Message: 3 of 3

Hi Image,

Thanks for your reply, however it does not answer my question.

> surf(peaks(30))
> colorbar('YTickLabel',...
> {'Freezing','Cold','Cool','Neutral',...
> 'Warm','Hot','Burning','Nuclear'})
Yes, I see this example, however, this example makes unit for each tick of colorbar and my case does not, only unit at the "top" of color bar in case of vertical orientation or only unit at "right end" in case of horizontal orientation.

=Edward=

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