Re: [R] altering legend with plot(density(..))

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Wed 02 Mar 2005 - 03:17:17 EST

Brian Hook wrote:

> On Tue, 01 Mar 2005 16:38:42 +0100, Uwe Ligges wrote:
>
>
>>So, can you tell us what is wrong with
>>set.seed(123)
>>plot(density(rnorm(100)))
>>and where the legend is? Maybe you don't like the defaults for
>>"xlab" or "main"?
>
>
> Ah, yes, I was confusing xlab with the legend. Sorry for that. In
> addition, "legend" wasn't showing up where I expected (beneath xlab)
> -- is there a way to put a legend outside of the graph itself?

So you are using legend() specifying coordinates outside the plot region?

Yes, it work if you set par(xpd=TRUE) before, see ?par.

Uwe Ligges

> Thank you,
>
> Brian
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 02 04:53:47 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:39 EST