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:
2 axes with different colors

Subject: 2 axes with different colors

From: Raphael J

Date: 16 Jun, 2010 13:39:05

Message: 1 of 4

Hi,
I would like to show 2 different sequences of images in two axes. The images in one axes should have the color gray, the other images jet.
But when I try to show images in the 2nd axes in jet, the color of the first axes change from gray to jet.

I use:
axes(handles.axes_VIS)
imshow(imread(fullfile(v_path,v_data(1+delta).name)),gray(2^8));
and...
axes(handles.axes_NIR)
imshow(imread(fullfile(n_path,n_data(1+delta).name)), jet(2^12));

Does anyone has an idea what I can do?

Thanks a lot!

Subject: 2 axes with different colors

From: Rob Campbell

Date: 16 Jun, 2010 14:32:04

Message: 2 of 4

You can only use one colormap per figure. You can think of the colormap as converting a gray-scale image to pseudo-colour. The alternative is to make color images using the color map of your choice. I have a function on the FEX which does what you want, check out the example image.
www.mathworks.com/matlabcentral/fileexchange/26322-mat2im

The only catch is that if you want a color-bar then you'll have to make it yourself. i.e. define new axis, plot the appropriate data, and set the y axis scale as desired.

Subject: 2 axes with different colors

From: us

Date: 16 Jun, 2010 14:39:06

Message: 3 of 4

"Raphael J" <raphael.jenski@rwth-aachen.de> wrote in message <hvak5p$kuo$1@fred.mathworks.com>...
> Hi,
> I would like to show 2 different sequences of images in two axes. The images in one axes should have the color gray, the other images jet.
> But when I try to show images in the 2nd axes in jet, the color of the first axes change from gray to jet.
>
> I use:
> axes(handles.axes_VIS)
> imshow(imread(fullfile(v_path,v_data(1+delta).name)),gray(2^8));
> and...
> axes(handles.axes_NIR)
> imshow(imread(fullfile(n_path,n_data(1+delta).name)), jet(2^12));
>
> Does anyone has an idea what I can do?
>
> Thanks a lot!

a hint:

http://www.mathworks.com/support/tech-notes/1200/1215.html

us

Subject: 2 axes with different colors

From: Raphael J

Date: 16 Jun, 2010 14:55:05

Message: 4 of 4

Thank you both!
Very fast response!

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