Thread Subject: COLORMAP

Subject: COLORMAP

From: ryan

Date: 28 Aug, 2007 11:38:12

Message: 1 of 5

I'm trying to have more than 1 axis on the same figure each
with its own colormap. Matlab states that it applies the
colormap to the figure. Is there any way to multiple color
maps on the multiple axis which all reside on the same figure???

thanks
ryan

Subject: COLORMAP

From: Rick Rosson

Date: 28 Aug, 2007 12:59:34

Message: 2 of 5

Hi Ryan,

The short answer, I think, is unfortunately "no". The colormap is a
property associated with the figure object, so that if a figure has more
than one set of axes, then all of the axes must have a single colormap.

As a workaround, however, it is possible to convert each image from 'index'
format to 'RGB' format using different colormaps for each. For example:

    X1 = uint8(255*rand(100,100));
    X2 = uint8(255*rand(100,100));

    map1 = gray(256);
    map2 = jet(256);

    Y1 = ind2rgb(X1,map1);
    Y2 = ind2rgb(X2,map2);

    figure;

    subplot(2,1,1);
    image(Y1);
    axis image;

    subplot(2,1,2);
    image(Y2);
    axis image;



For more information, type

    doc ind2rgb

at the command prompt.


I hope that helps.

Thanks.

Rick



"Ryan " <ryan.kelly@mikelinc.com> wrote in message
news:fb11f4$jtl$1@fred.mathworks.com...
> I'm trying to have more than 1 axis on the same figure each
> with its own colormap. Matlab states that it applies the
> colormap to the figure. Is there any way to multiple color
> maps on the multiple axis which all reside on the same figure???
>
> thanks
> ryan

Subject: COLORMAP

From: Dan Sternberg

Date: 28 Aug, 2007 15:28:09

Message: 3 of 5

Hi Ryan,

You may want to look at the folowing tech note:

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

-I hope this helps.
 Dan

---
Dan Sternberg
The MathWorks, Inc.

"Ryan " <ryan.kelly@mikelinc.com> wrote in message
news:fb11f4$jtl$1@fred.mathworks.com...
> I'm trying to have more than 1 axis on the same figure each
> with its own colormap. Matlab states that it applies the
> colormap to the figure. Is there any way to multiple color
> maps on the multiple axis which all reside on the same figure???
>
> thanks
> ryan

Subject: COLORMAP

From: Andrew Stevens

Date: 28 Aug, 2007 16:28:39

Message: 4 of 5

"Dan Sternberg" <dsternbeNO@SPAMmathworks.com> wrote in
message <fb1eua$ue$1@fred.mathworks.com>...
> Hi Ryan,
>
> You may want to look at the folowing tech note:
>
> http://www.mathworks.com/support/tech-notes/1200/1215.html
>
> -I hope this helps.
> Dan
>
> ---
> Dan Sternberg
> The MathWorks, Inc.
>
> "Ryan " <ryan.kelly@mikelinc.com> wrote in message
> news:fb11f4$jtl$1@fred.mathworks.com...
> > I'm trying to have more than 1 axis on the same figure each
> > with its own colormap. Matlab states that it applies the
> > colormap to the figure. Is there any way to multiple color
> > maps on the multiple axis which all reside on the same
figure???
> >
> > thanks
> > ryan
>
>

Ryan,

I have had success using freezeColors, available on the FEX.

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=7943&objectType=file

Andrew

Subject: COLORMAP

From: ryan

Date: 31 Aug, 2007 18:40:46

Message: 5 of 5

I've noticed that the examples all use subplot and not plot.
I've tried this using 2 axes on a gui using guide and i
didn't get the same results. Basically I had 2 axes and used
the example of multiple color maps on multiple axes. The
only thing different is that I'm not using subplot. Any
ideas why this only works with subplot??

ryan


"Dan Sternberg" <dsternbeNO@SPAMmathworks.com> wrote in
message <fb1eua$ue$1@fred.mathworks.com>...
> Hi Ryan,
>
> You may want to look at the folowing tech note:
>
> http://www.mathworks.com/support/tech-notes/1200/1215.html
>
> -I hope this helps.
> Dan
>
> ---
> Dan Sternberg
> The MathWorks, Inc.
>
> "Ryan " <ryan.kelly@mikelinc.com> wrote in message
> news:fb11f4$jtl$1@fred.mathworks.com...
> > I'm trying to have more than 1 axis on the same figure each
> > with its own colormap. Matlab states that it applies the
> > colormap to the figure. Is there any way to multiple color
> > maps on the multiple axis which all reside on the same
figure???
> >
> > thanks
> > ryan
>
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com