How to plot single colorful line?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Zack Trahem
el 20 de Jun. de 2023
Comentada: Zack Trahem
el 20 de Jun. de 2023
Iam trying to plot a single line graph varaying colororder depending on the intensity increse.
x=[1 2 3 4 5 6 ];
y=[1 2 3 4 5 6 ];
plot(x,y), colororder(jet)
expecting to color change over line. Thank you.
0 comentarios
Respuesta aceptada
KSSV
el 20 de Jun. de 2023
x=[1 2 3 4 5 6 ];
y=[1 2 3 4 5 6 ];
z = zeros(size(x));
col = x; % This is the color, vary with x in this case.
surface([x;x],[y;y],[z;z],[col;col],...
'facecol','no',...
'edgecol','interp',...
'linew',2);
Ver también
Categorías
Más información sobre Colormaps 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!