I run this code
A = uint8( ones( 200 ) );
a = [ A * 0 A * 1; ...
A * 2 A * 3 ];
color_map = [ 0 0 0; ...
0.3 0.3 0.3; ...
0.9 0.3 0.1; ...
1 1 1; ...
zeros( 252, 3 ) ];
h = image( a );
colormap( color_map );
Then, I select a point in the figure using the datatip feature. This makes the colors in the figure change. They still have the same indices and RBG values, but they are different colors. Then, I delete the datatip, and the colors return to their proper colors.
Using,
set(gcf, 'Renderer', 'opengl')
makes the issue go away, but I'm wondering if there is a way to avoid having to do that? I am using MATLAB R2013b.
color_map2 = [0 0 0;.3 .3 .3;.9 .3 .1;1 1 1]; h = image(a);colormap(color_map2);
– Masquefeature('usehg2',1)
or running MATLAB with the-hgVersion 2
command-line option, as per this UndocumentedMatlab post. – Higinbothamdoc datatip
comes up with a window that showsdatatip is obsolete
, FYI. – Bays