How to make a line plot with Jet colored lines?
27 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi everyone!
I would like to make a line plot of the attached data. There are about 64 different lines in the single plot.
So, I use the following command.
zz1.zz1 = load('z1.mat');
zz1.zz2 = load('x2.mat');
plot(zz1.zz2.X2_axis, zz1.zz1.Z2_axis)
I get the following attached figure.
Instead I want the lines to follow jet colorbar.
Something like
cmp1 = colorbar(jet(64));
plot(zz1.zz2.X2_axis, zz1.zz1.Z2_axis,'Color',cmp1);
But, this throws error!
Any help will be greatly appriciated.
0 comentarios
Respuesta aceptada
Chunru
el 17 de Ag. de 2022
Editada: Chunru
el 17 de Ag. de 2022
15 comentarios
Chunru
el 18 de Ag. de 2022
You can flip SN or h.Children. Alternatively, use a loop:
for i=1:size(zz1.zz1.Z2_axis, 2)
plot(zz1.zz2.X2_axis(:, i), zz1.zz1.Z2_axis(:,i), 'DisplayName', SN(i));
end
% Assume that SN is string array
Más respuestas (0)
Ver también
Categorías
Más información sobre Legend 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!