Skip to content
Prev 70353 / 398506 Next

Placing A Legend in Titlle of a Plot

Without a small example to see what you are doing it is hard to respond. There are plenty of examples in the help for legend showing placement all over the place. So I am guessing that this might help (The only thing added from the help was the par(xpd = TRUE)


     x <- 0:64/64
     y <- sin(3*pi*x)
     plot(x, y, type="l", col="blue", main = "")
     points(x, y, pch=21, bg="white")
     par(xpd = TRUE)
     legend(.4,1.25, "sin(c x)", pch=21, pt.bg="white", lty=1, col = "blue")
     par(xpd = FALSE)

Tom