How to make a line plot with Jet colored lines?

9 views (last 30 days)
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.

Accepted Answer

Chunru
Chunru on 17 Aug 2022
Edited: Chunru on 17 Aug 2022
zz1.zz1 = load('z1.mat');
zz1.zz2 = load('x2.mat');
cmp1 = jet(64);
% Use colororder
colororder(cmp1);
plot(zz1.zz2.X2_axis, zz1.zz1.Z2_axis);
h=gca;
legend(h.Children, 'Location', 'Eastoutside', 'NumColumns', 2, 'FontSize', 6)
  15 Comments
MP
MP on 18 Aug 2022
Yes, that is perfect. @Chunru
Thank you very much.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!