saving . . .savedoutcome is different by typing command. has been deleted.outcome is different by typing command. has been hidden .
outcome is different by typing command.
Title
Question
when we make 2 graphs in one plot, the 2 plots sin and cos with their name appears; but I can only see sin name without cos name even after typing correct command. My plot names are not completely visible.
Please make sure that you are typing the commands as shown above.
04-05-20, 11:16 p.m.sudhakarst
x <- seq(-pi, pi, 0.1)
y <- sin(x)
plot(x, y) plot(x, y, main="Plotting a Sine Curve", ylab="sin(x)") plot(x, y, main="Plotting sine curve", ylab="sin(x)", type="l", col="blue") plot(x, sin(x), main="Plotting Sine and Cosine graphs on the same plot",
ylab=" ", type="l", col="blue")
lines(x, cos(x), col="red") legend("topleft",
c("sin(x)", "cos(x)"),
fill=c("blue","red"))
In the second argument the name cos(x) is not printed on graph. Also sin(x) overlapping the lines of graph.
c("sin(x)", "cos(x)"),
fill=c("blue","red"))
y <- sin(x)
plot(x, y)
plot(x, y, main="Plotting a Sine Curve", ylab="sin(x)")
plot(x, y, main="Plotting sine curve", ylab="sin(x)", type="l", col="blue")
plot(x, sin(x), main="Plotting Sine and Cosine graphs on the same plot",
ylab=" ", type="l", col="blue")
lines(x, cos(x), col="red")
legend("topleft",
c("sin(x)", "cos(x)"),
fill=c("blue","red"))
Login to add comment