Can I specify a particular matrix for the colorbar?

I'd like to create a map using one particular matrix of data (log-transformed), but make the colorbar from a different matrix data (un-transformed). Is this possible? Can I specify for the colorbar to pull info from a matrix that wasn't used for the map?

 Respuesta aceptada

Image Analyst
Image Analyst el 10 de Sept. de 2013

0 votos

No, the colorbar represents the colormap in use. For example you can't show a grayscale colorbar while having the image use the "jet" pseudocolor lookup table/colormap. Though you can redefine what the tick marks say. And you can put up an image the same size as the colorbar right where it would go and display any RGB image in there you'd like (for example a colorbar that looks like what you want rather than the color map that is actually being used on the image being displayed.)

5 comentarios

Maureen
Maureen el 10 de Sept. de 2013
is there a way to freeze the colorbar and then replace the map with other data? or vice versa?
Image Analyst
Image Analyst el 10 de Sept. de 2013
Not that I'm aware of. Why do you want the colorbar to be something that doesn't represent the true color map that is being used?
Maureen
Maureen el 13 de Sept. de 2013
i want the patterns in the map to be of log10 data, however i want the colorbar to show the real untransformed values, not the logged values.
Image Analyst
Image Analyst el 13 de Sept. de 2013
I know. I just didn't see why you'd want that deceptive colormap. So that's why I asked "WHY do you want...?" instead of "What do you want".
Maureen
Maureen el 17 de Sept. de 2013
for the chlorophyll data i'm using, it's an accepted tool in order to see patterns in areas of deep water that normally would not be showing any patterns because of the small differences in values.

Iniciar sesión para comentar.

Más respuestas (2)

Sean de Wolski
Sean de Wolski el 10 de Sept. de 2013

0 votos

It is possible to do what you want by adjusting the 'CData' properties of the various graphics objects and the 'YLim' property of the colorbar.
I did this with my meshCanopy file.

2 comentarios

Maureen
Maureen el 10 de Sept. de 2013
is there a way to freeze the colorbar and then replace the map with other data? or vice versa? i'm using m_datamap for my mapping function.
Sean de Wolski
Sean de Wolski el 12 de Sept. de 2013
Aptly named: FEX:freezecolors. Also look at the files it's inspired.

Iniciar sesión para comentar.

Kelly Kearney
Kelly Kearney el 17 de Sept. de 2013
You've accepted an answer, but I'm not sure you've actually solved your problem. If I'm guessing correctly, you aren't really looking for a different colormap... you just want to label the colorbar with the more human-readable value. Is this the sort of thing you're looking for?
pcolor(log10(z)); % z is your chlorophyll data
cb = colorbar;
tk = [0.01 0.1 1 10 50]';
set(cb, 'ytick', log10(tk), 'yticklabel', num2str(tk));

1 comentario

Maureen
Maureen el 25 de Sept. de 2013
unfortunately, none of these suggestions have solved my issue. I am beginning to think there might not be a way to do this in Matlab.

Iniciar sesión para comentar.

Categorías

Más información sobre Color and Styling en Centro de ayuda y File Exchange.

Preguntada:

el 10 de Sept. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by