Hold on Not showing all of my plots on one graph

17 次查看(过去 30 天)
Q = .07; %(kg/s)
H = 225; %(m)
x = 0.2:10^-3:100;
Bx = 0.2:10^-3:100;%(km)
y = 0 ;%(km)
z = 0; %(km)
U = 3.1 ;%(m/s)
a = 68;
b = .894;
if x < 1 %(km)
c = 33.2;
d = .725;
f = -1.7;
else c = 44.5;
d = .516;
f = -13;
sigmay = a*x.^b;
sigmaz = c*x.^d + f;
Ba = 156;
Bb = .894;
if x < 1 %(km)
Bc = 106.6;
Bd = 1.149;
Bf = 3.3;
else Bc = 108.2;
Bd = 1.098;
Bf = 2.0;
Bsigmay = a*Bx.^b;
Bsigmaz = c*Bx.^d + f;
loglog(Bx,Bsigmay,'b')
hold on
loglog(Bx,Bsigmaz,'r')
hold on
loglog(x,sigmay)
hold on
loglog(x,sigmaz)
end
end
I am trying to plot for lines on one graph but only two lines are showing up. I have used the "hold on" command but it still only plots two lines instead of four.

采纳的回答

Alex Mcaulley
Alex Mcaulley 2020-2-4
Take a look at the variables you are plotting, they are duplicated. I mean Bsigmay is equal to sigmay, Bsigmaz is equal to sigmaz and Bx is equal to x. Then, your lines are overlapped and you can see just two lines.

更多回答(1 个)

Ari Henderson
Ari Henderson 2020-2-4
I realized that mistake right before you answered. Thank you!!!

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by