Re: [R] how to plot a nice legend?

2012-02-13 Thread William Stockhausen
Jonas, A relatively simple way to get the legend to plot beside a graph is to use the "layout" function to create two plot areas, create the graph in the first area and the legend in the second area. You can fool around with the location of the legend by changing the parameters to "layout": layo

Re: [R] how to plot a nice legend?

2012-02-12 Thread Duncan Murdoch
On 12-02-11 9:07 PM, Jonas Stein wrote: Wrong? Nothing. You told R to put the legend at c(1,3) so it did. If you want it elsewhere you need to specify that. legend(-1,3, legend=c("one", "two"), inset=-1, xpd=NA) maybe, or some other location? ok that works fine. Now i understand how to use it.

Re: [R] how to plot a nice legend?

2012-02-12 Thread John Kane
a,b, colour=c)) + geom_point() -- John Kane Kingston ON Canada > -Original Message- > From: n...@jonasstein.de > Sent: Sun, 12 Feb 2012 02:07:06 +0100 > To: r-h...@stat.math.ethz.ch > Subject: Re:

Re: [R] how to plot a nice legend

2012-02-12 Thread Bretschneider SIG-R
Dear Jonas Stein, You may add a line defining a large margin to harbour the legend, such as: par(mai=c(0.5, 0.5, 0.5, 1.8)) # enlarged right margin plot(1:10) legend("right", legend=c("one", "two"), inset=-0.2, xpd=NA) Kind regards, Franklin Bretschneider -- Dept

Re: [R] how to plot a nice legend?

2012-02-11 Thread Jonas Stein
> Wrong? Nothing. You told R to put the legend at c(1,3) > so it did. If you want it elsewhere you need to specify that. > legend(-1,3, legend=c("one", "two"), inset=-1, xpd=NA) > maybe, or some other location? ok that works fine. Now i understand how to use it. If i create several plots it would

Re: [R] how to plot a nice legend?

2012-02-11 Thread Sarah Goslee
Hi, On Sat, Feb 11, 2012 at 8:07 PM, Jonas Stein wrote: >> There are various alternatives available; you can also write your own, >> by modifying the standard one. > >> Generally there are lots of possibilities for customizing within the >> standard one; e.g. y.intersp will affect the line spacin

Re: [R] how to plot a nice legend?

2012-02-11 Thread Jonas Stein
> There are various alternatives available; you can also write your own, > by modifying the standard one. > Generally there are lots of possibilities for customizing within the > standard one; e.g. y.intersp will affect the line spacing, using a > negative value for inset (together with xpd=NA)

Re: [R] how to plot a nice legend?

2012-02-11 Thread Duncan Murdoch
On 12-02-10 3:45 PM, Jonas Stein wrote: i'd like to plot a legend in my diagram. The diagram will be included in a TikZ LaTeX document later. I tried the legend() function, but - it can not find a good place it self where the legend fits and playing around with coordinates and scaling consume

[R] how to plot a nice legend?

2012-02-11 Thread Jonas Stein
i'd like to plot a legend in my diagram. The diagram will be included in a TikZ LaTeX document later. I tried the legend() function, but - it can not find a good place it self where the legend fits and playing around with coordinates and scaling consumes a lot time - standard settings for the