saving . . . saved outcome is different by typing command. has been deleted. outcome is different by typing command. has been hidden .
outcome is different by typing command.
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.

R Introduction-to-ggplot2 06-07 min 50-60 sec 03-05-20, 10:08 p.m.


Could you please share the exact command which you are talking about? 
04-05-20, 5:58 p.m. sudhakarst

c("sin(x)", "cos(x)"),


04-05-20, 11:10 p.m.
x <- seq(-pi, pi, 0.1)
plot(x, sin(x),
     main = "Two graphs in one plot",
     ylab = "",
     type = "l",
     col = "blue")
lines(x, cos(x),
      col = "red")
       fill = c("blue","red"))
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")
       c("sin(x)", "cos(x)"),

In the second argument the name cos(x) is not printed on graph. Also sin(x)  overlapping the lines of graph.
04-05-20, 11:17 p.m.

Login to add comment

Log-in to answer to this question.