How to fix this error?

24 visualizaciones (últimos 30 días)
Rizwana
Rizwana el 10 de Mzo. de 2014
Respondida: pranshu saxena el 13 de Jun. de 2018
cmap=menu('Choose a color','jet','hsv','summer','cool','spring','hot','autumn','winter','bone','copper','pink','lines','Gray');
contourf (x, y, z,50);
colormap (cmap);
It is throwing error which say's..
Error using colormap (line 58)
First argument must be a scalar axes or figure handle.
I know cmap is holding the position of the item in the list. I want the value so that i can use in in colormap
Thanks
Rizwana

Respuesta aceptada

Dishant Arora
Dishant Arora el 10 de Mzo. de 2014
cmap=menu('Choose color','jet','hsv','summer','cool','spring','hot','autumn',...
'winter','bone','copper','pink','lines','Gray'); % menu returns index of selected choice.
map={'jet','hsv','summer','cool','spring','hot','autumn',...
'winter','bone','copper','pink','lines','Gray'};
colormap(map{cmap});
  1 comentario
Rizwana
Rizwana el 10 de Mzo. de 2014
Thanks alot. I was trying to fix this error since morning... Thanks once again

Iniciar sesión para comentar.

Más respuestas (1)

pranshu saxena
pranshu saxena el 13 de Jun. de 2018
xx=rgb2gray(yellow_nuclei);% yellow_nuclei is an color image subplot(1,2,2); y=image(xx); title('Yellow Cytoplasmic Element'); imwrite(xx,'cyp.jpg'); colormap(y,hot), title('Yellow nuclei');
showing this error? First argument must be a scalar axes or figure handle.
Thanks in advance

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by