How can I print the heatmap as grayscale?

17 visualizaciones (últimos 30 días)
도현 김
도현 김 el 12 de Abr. de 2021
Respondida: Richard Quist el 6 de Dic. de 2021
A = rand(5)
heatmap(A, option)
I want to see heatmap in grayscale.
OR
Can I use 'saveas' to save in grayscale?

Respuesta aceptada

J Chen
J Chen el 12 de Abr. de 2021
heatmap(A)
colormap(gray)
  4 comentarios
Sean de Wolski
Sean de Wolski el 12 de Abr. de 2021
colormap(flip(gray))
도현 김
도현 김 el 15 de Abr. de 2021
Thank you sir !!!

Iniciar sesión para comentar.

Más respuestas (1)

Richard Quist
Richard Quist el 6 de Dic. de 2021
As of R2021a the exportgraphics function supports a Colorspace option for both image and vector formats that you can use to generate grayscale output:
exportgraphics(gca, 'output.jpg', 'colorspace', 'gray');
exportgraphics(gca, 'output.pdf', 'colorspace', 'gray');

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by