try:

y<-c(1960, 1965, 1970, 1975)
z<-c(1, 2, 3, 4)
plot(y, z, type="l", col = 2)
legend("topleft", "legend text", pch = 1, xjust = 0.5)



On 2/28/07, Emili Tortosa-Ausina <[EMAIL PROTECTED]> wrote:
>
> Hi to all,
>
> I'm sorry for posting this question, I am sure I am missing something
> important but after reading the documentation I cannot find where the
> problem is.
>
> I want to add a legend to a figure. If I use a simple example drawn
> from the R Reference Manual such as, for instance:
>
> x <- seq(-pi, pi, len = 65)
> plot(x, sin(x), type="l", col = 2)
> legend(x = -3, y = .9, "legend text", pch = 1, xjust = 0.5)
>
> then everything works just fine.
>
> However, if I use other data such as, for instance:
>
> y<-c(1960, 1965, 1970, 1975)
> z<-c(1, 2, 3, 4)
> plot(y, z, type="l", col = 2)
> legend(x = -3, y = .9, "legend text", pch = 1, xjust = 0.5)
>
> then the legend is not shown.
>
> Any hints?
>
> Thanks in advance,
>
> Emili
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to