How to plot into a PNG image?

1 次查看(过去 30 天)
matlabuser12
matlabuser12 2016-7-5
I have a script that plots a 3x3 grid of values as a colormap:
Data = [1:1:9; 1 2 3 4 5 6 7 8 9; 1 2 3 4 5 6 7 8 9 ;1 2 3 4 5 6 7 8 9;1 2 3 4 5 6 7 8 9];
M = zeros(3,3);
for ii = 2:size(Data,1)
plot(ii-1)
M(1:end) = Data(ii,:);
imagesc(M)
colormap jet
shading flat %for an exact result
% shading interp %for a smooth result
figure
end
These values/color intensities represent time spent in a given area. I have a picture of that area (which does not match the shape of the plot it is kinda oblong looking) saved as a png that I want to plot this grid into and fill the gray scale image with the colors instead of getting grid. Is this possible? I have tried to follow this blog post: http://blogs.mathworks.com/steve/2009/02/18/image-overlay-using-transparency/ but it is leading me nowhere. I do have the image processing toolbox if that helps. Thank you

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Orange 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by