Lines are a no show using loglog and a for loop
Show older comments
So here is my code... ~~~~~~~~
function []= FFAplot(a,b,k)
P=.01;
T=1/P;
if length(a)==length(b) && length(b)==length(k)
for i=1:length(a)
Q=b(i)+(a(i)/k(i))*(1-(-log(1-P))^k(i));
loglog(T,Q)
xlim([1,100]);
hold on
grid on
end
else
error('Length of vectors not the same')
end
xlabel('Return period (yr)')
ylabel('Flood magnitude (cfs)')
legend('show')
end
By the way I used these as my a, b, k variables.
a=[2000 1000 4000];
b=[30000 40000 50000];
k=[-.3 -.1 -.4];
HOWEVER, the plot is not showing the lines.... It shows that there are line in the legend just not lines on the loglog graph. PLEASE SOME ONE HELP I AM GOING CRAZY.
<<

>>

%
Accepted Answer
More Answers (1)
The "lines" are there, but you do not see them, because they are dots on the right border. Use this to see them:
loglog(T, Q, 'o')
1 Comment
Jason Kolodziej
on 29 Jan 2017
Categories
Find more on Discrete Data Plots 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!
