How to create color map?
이전 댓글 표시
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
Adam Danz
2020년 6월 5일
If you have a screenshot, that might fill in some of the missing info.
For example, is 15-20 1 full bar? 20-25 one full bar?
Image Analyst
2020년 6월 6일
What is a 2x500 bar graph??? To have each bar be a custom color, see attached demo.

Adam Danz
2020년 6월 7일
Ilkin Abdullayev's answer moved here as a comment.
Hello,
The bar graph which I have is the same as in the picture that I uploaded. 2x500 was wrong actually I wrote like that by a mistake. So what I have now , a data which contain 7 column and 10000 thousand row. My first column which is a distance in m will be my x axis. And for each distance we have 6 different number which ar represtend in the rest 6 column. So when I plot a bar graph each bar will contain 6 different color. So i need a colormap where I need to specify that for example the numbers between 20 and 25 is blue, between 43 and 50 is red and so on. I hope i explanied clearly.

Adam Danz
2020년 6월 7일
Still not clear. It sounds like you want to plot a stacked bar graph but there are still some leftover questions. The image you shared isn't a bar graph.
I understand that column 1 defines the x values for each bar but does that mean you expected to have 1000 bars?
Or maybe you want 6 bars each with 1000 segments? Or perhaps the 1000 values are broken up into different bar segements but that isn't explained.
See the link I shared above and try to construct your stacked bar plot, if I interpretted your description correctly, and we can help you out when you get stuck.
Ilkin Abdullayev
2020년 6월 7일
Ilkin Abdullayev
2020년 6월 8일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Networks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
