How to create color map?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ilkin Abdullayev
el 5 de Jun. de 2020
Comentada: Adam Danz
el 12 de Jun. de 2020
Hello everybody,
I plot a bargraph by using 2x500, and I need to create a colormap. However it is a bit strange colormap so I need code that, for example, all the values between 15-20 will be blue, all the values between 20-25 will be red and so on. I have never worked with bar colormap and especially with this kind of code. If someone can help I would be very glad.

Thanks in advance.
6 comentarios
Respuesta aceptada
Adam Danz
el 8 de Jun. de 2020
Editada: Adam Danz
el 10 de Jun. de 2020
Use a stacked bar graph by entering an nxm matrix which will produce n bars each with m segments.
h = bar(rand(20,40), 'stacked'); % 20 bars, 40 segments each
Change the color of bars 15-20 to blue.
set(h(15:20), 'FaceColor', 'b')
2 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

