Multiple line Style on a yyaxis plot

6 views (last 30 days)
Elodie Newman
Elodie Newman on 6 Apr 2021
I've plotted data from several tables in dat files on a yyaxis plot using:
S=["10D.dat","12D.dat","15D.dat","19D.dat","21D.dat","24D.dat","27D.dat","45D.dat","63D.dat","90D.dat","105D.dat"];
for k =1:numel(S)
T= readtable(S(k),"VariableNamingRule","preserve");
T = renamevars(T, ["Var1", "Var2", "Var3", "Var4"], ["Time","Ts","Rd", "Teff"])
yyaxis left
plot(T.Time, T.Rd)
yyaxis right
plot(T.Time, T.Ts)
hold on
end
grid on
yyaxis left
xlabel('Time [ms]')
ylabel('Droplet Radius [um]')
title('Pure Diesel')
yyaxis right
ylabel('Tempreture [K]')
However, My plot comes out like this:
But because there are so many data sets, some of the lines have markers in, making the plot difficult to read.
Is there a way of making all of the lines some varient of dashed?? I'm not bothered about colour.
And how can i get the legend to display just one set of 10-105??

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!