How to create color map?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ilkin Abdullayev
il 5 Giu 2020
Commentato: Adam Danz
il 12 Giu 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 Commenti
Risposta accettata
Adam Danz
il 8 Giu 2020
Modificato: Adam Danz
il 10 Giu 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 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

