Re: [R] legend question

2007-03-01 Thread John Kane
? par it is the xpd you're looking for. x - seq(-pi, pi, len = 65) par(xpd=TRUE) plot(x, sin(x), type=l, col = 2,xpd=NA) legend(x = 0, y = -1.5, legend text, pch = 1, xjust = 0.5) --- Jenny Barnes [EMAIL PROTECTED] wrote: Hi folks, Do you mind if I ask a related question that I have

[R] legend question

2007-02-28 Thread Emili Tortosa-Ausina
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 -

Re: [R] legend question

2007-02-28 Thread Ranjan Maitra
On Wed, 28 Feb 2007 17:06:18 +0100 Emili Tortosa-Ausina [EMAIL PROTECTED] wrote: 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) your x and y are outside the plotting area. try using a different set, or

Re: [R] legend question

2007-02-28 Thread Stephen Tucker
Hi Emili, Even though you are calling your horizontal coordinate y, and vertical coordinate z, the first and second arguments to legend(), namely x and y, should be the horizontal and vertical coordinates, respectively; and they are given in user coordinates (e.g., legend()'s x should be between

Re: [R] legend question

2007-02-28 Thread jim holtman
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

Re: [R] legend question

2007-02-28 Thread Jenny Barnes
Hi folks, Do you mind if I ask a related question that I have been having trouble with - how do you put the legend outside of the plot area (to the bottom of the area - below the x-axis title)? Could anybody show me using the example given below: x - seq(-pi, pi, len = 65) plot(x, sin(x),

Re: [R] legend question

2007-02-28 Thread Sebastian P. Luque
On Wed, 28 Feb 2007 16:52:05 + (GMT), Jenny Barnes [EMAIL PROTECTED] wrote: Hi folks, Do you mind if I ask a related question that I have been having trouble with - how do you put the legend outside of the plot area (to the bottom of the area - below the x-axis title)? Could anybody show