Updating CData of subimage unwantedly resets its colormap
显示 更早的评论
Hi. Below is a class which manages 2 subimages in 1 figure. Both have different colormaps. However, as soon as i try to update the CData of either subimage, its colormap also gets reset. This is not what I want. Instead, I want the colormap to remain the same. Besides redrawing the entire figure, I'm unsure how.
classdef ImageTest
properties
image_1;
image_2;
end
methods
function obj = ImageTest()
figure(1);
subplot(1,2,1);
obj.image_1 = subimage(rand(5)*100, autumn);
subplot(1,2,2);
obj.image_2 = subimage(rand(5)*100, gray);
end
function obj = Change(obj)
set(obj.image_1, 'cdata', rand(5)*100);
drawnow;
end
end
end
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Web Map Service 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!