Imagesc defining only 3 colours for my entire data
Mostrar comentarios más antiguos
hi i have a matrix that is 500x600 within this i have data values ranging from 0.2 to -0.2
i have looked at user the figure colour map editor but i cannot get my desired results.
i am hoping to set out a plot with these distinctive properties for the values:
0.2>x> 0.07 - Red
0.07>x>0 - green
x = 0 - Blue
0>x>-0.07 - Green
-0.07>x>0.2 - Red
is there anyway to alter the plot to show the results in this manner?
thanks for any help Kyle
figure(i)
subplot(3,1,1);
imagesc(ux);
axis equal off
colorbar
Respuestas (1)
Image Analyst
el 18 de Ag. de 2013
Make a 256 row colormap. Then determine the index where the changes happen. For example 0 is at row 128, and 0.07 is at row 129 or whatever. Then make up the colormap and apply it
myColorMap(0:row1, :) = [1,0,0]; % Red
myColorMap(row1+1:127, :) = [0,1,0]; % Green
myColorMap(128,:) = [0, 0, 1]; % Blue
and so on.
2 comentarios
kyle lyth
el 19 de Ag. de 2013
Editada: Image Analyst
el 19 de Ag. de 2013
Image Analyst
el 19 de Ag. de 2013
That can be vectorized into 3 faster lines. But anyway, I don't see how that applies colors.
Categorías
Más información sobre Blue en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!