From: Jan Simon on
Dear fas!

What happens if you type:
colormap([1,0,0; 1,1,1])

Or set the property directly:
set(gcf, 'ColorMap', [1,0,0; 1,1,1])

Does this help? Jan
From: ImageAnalyst on
On Jan 1, 11:29 pm, fas <faisalmu...(a)gmail.com> wrote:
> I am afraid that I posted this question after going through the help/
> doc file. Since after several experiments, I failed to do so I am
> asking for help if any ???
------------------------------------------------------------------------------------------------------------------------
OK, perhaps this demo I wrote for you will help you to not fail
anymore.
Be sure to join any lines broken into two by the newsreader.


% Demo to apply random colormaps to a gray scale image.
% by ImageAnalyst
clc;
close all;
clear all;
workspace; % Display workspace panel.
clc;
close all;
clear all;
workspace; % Display workspace panel.
% Read in standard MATLAB demo image.
grayImage = imread('cameraman.tif');
subplot(1, 2, 1);
imshow(grayImage);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.

% Make color maps - loop applying random colormaps until told to stop.
gl = 1:256;
promptMessage = sprintf('Do you want to continue with a different
colormap?');
count = 1;
while true
% Make sine wave colormaps.
rOffset = 256*rand(1,1);
gOffset = 256*rand(1,1);
bOffset = 256*rand(1,1);
period = 50;
cmapR = (sin((gl-rOffset)/period)+1)/2;
cmapG = (sin((gl-gOffset)/period)+1)/2;
cmapB = (sin((gl-bOffset)/period)+1)/2;
cmap = [cmapR; cmapG; cmapB]';

% Plot colormap in the second axes
subplot(1, 2, 2);
hold off;
plot(gl, cmapR, 'r-');
hold on;
plot(gl, cmapG, 'g-');
plot(gl, cmapB, 'b-');
caption = sprintf('Random colormap #%d', count);
title(caption);

% Apply colormap to the axes containing the image.
subplot(1, 2, 1);
colormap(cmap);
caption = sprintf('Image pseudocolored with random colormap #%d',
count);
title(caption);

% Ask user if they want another colormap
button = questdlg(promptMessage, 'Continue with another colormap?',
'Continue', 'Cancel', 'Continue');
if strcmp(button, 'Cancel')
break;
end
count = count + 1;
end


From: fas on
On Jan 2, 3:46 pm, "Jan Simon" <matlab.THIS_Y...(a)nMINUSsimon.de>
wrote:
> Dear fas!
>
> What happens if you type:
>   colormap([1,0,0; 1,1,1])
>
> Or set the property directly:
>   set(gcf, 'ColorMap', [1,0,0; 1,1,1])
>
> Does this help? Jan

Thanks Jan, precisely what I want!.