How to plot multiple 2D matrix data with different color on the same figure?
显示 更早的评论
Hi,
I have multiple 200x100 data matrixes, and I want to plot them on the same figure with different color. It is similar as hold on with plot function except I want to display them similar as image. Normally I use imagesc to plot these matrixes data and hold on just doesn't work since the final imgae I get is the last data matrix.
The data output on the figure is similar as follwoing:

Thanks for helping me!
回答(2 个)
clear all; close all; clc;
im1 = imread('cameraman.tif');
im2 = imread('rice.png');
figure;
h1 = imagesc(im1);
set(h1, 'AlphaData', 0.8)
hold on;
h2 = imagesc(im2);
set(h2, 'AlphaData', 0.2)
axis equal;
类别
在 帮助中心 和 File Exchange 中查找有关 Images 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


