How to set manual values for colorbar
조회 수: 50(최근 30일)
I want to create an colorbar with three colors (red, yellow, green) and I want to set the values for these colors.
Red = 100 to max value image
Yellow = 50-100
Green - 0-50
Can someone help me how to set the values for the colors manually.
LauraLee Austin 2016년 10월 31일
Let's assume the max value is 128 and your data is in a matrix X. I'm going to modify a demo file of earth to have values greater than 100 for this example.
m=128; % set max value
c=zeros(m,3); % start with all 0's