Fill line with colors using the heatmap

6 visualizaciones (últimos 30 días)
Eric
Eric el 2 de Oct. de 2019
Comentada: Eric el 2 de Oct. de 2019
Hey everyone,
I'm currently trying to use the function:
plot
to create af figure similar to this:
Plot_How.png
Does anyone know how to use the heatmap function with the plot function?
Thanks,
Eric

Respuesta aceptada

darova
darova el 2 de Oct. de 2019
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
img1.png
  1 comentario
Eric
Eric el 2 de Oct. de 2019
Thanks a lot! That was exactly what I needed to do!
It's much appreciated!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by