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
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.
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:
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
> 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
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
> 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)
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
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
9 matches
Mail list logo