Fill line with colors using the heatmap
8 次查看(过去 30 天)
显示 更早的评论
Hey everyone,
I'm currently trying to use the function:
plot
to create af figure similar to this:
Does anyone know how to use the heatmap function with the plot function?
Thanks,
Eric
0 个评论
采纳的回答
darova
2019-10-2
What about pcolor()
clc,clear
n = 50;
x = linspace(-5,5,n);
[X,Y] = meshgrid(x);
for i = 1:n
y = sinc(x(i))+0.5;
Y(:,i) = linspace(0,y,n);
end
Z = Y;
h = pcolor(X,Y,Z);
% set(h,'edgecolor','none')
shading interp
colorbar
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!