looking for some solutions? You are welcome.

SOLVED: Coloring for the curve()

Camford Oxbridge:

We can change the background color as follows:

    graphics::par(bg= "gray12",  
                  fg="gray",
                  col.lab="bisque2" , 
                  col.axis="bisque2" , 
                  col.main="bisque2" ,
                  cex.lab=1.5,
                  cex.axis=1.3
    )

plot(c(1,2),c(11,22))

But this treatment does not work for the following code.

        graphics::par(bg= "gray12",  
                      fg="gray",
                      col.lab="bisque2" , 
                      col.axis="bisque2" , 
                      col.main="bisque2" ,
                      cex.lab=1.5,
                      cex.axis=1.3
        )



  curve(dnorm(x,350.92,0.85),340,360,add = TRUE,col = "red")

  curve(dnorm(x,350,3),340,360,add = TRUE,col = "green")

How to change the background color for the code curve(dnorm(x,350,3),340,360,add = TRUE,col = "green")


By eliminate the add=TRUE in the first curve(), it goes well.

        graphics::par(bg= "gray12",  
                      fg="gray",
                      col.lab="bisque2" , 
                      col.axis="bisque2" , 
                      col.main="bisque2" ,
                      cex.lab=1.5,
                      cex.axis=1.3
        )



  curve(dnorm(x,350.92,0.85),340,360,               ,col = "red")

  curve(dnorm(x,350,3),340,360,      add = TRUE,     col = "green")



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent