I'm having a hard time modifying the legend that is emitted by default when calling plot(density(...)) and then legend(). I've looked at the docs and I'm not sure what I'm doing wrong, if anything. Any advice appreciated. Thanks, Brian
altering legend with plot(density(..))
5 messages · Brian Hook, Uwe Ligges, Martin Maechler
Brian Hook wrote:
I'm having a hard time modifying the legend that is emitted by default when calling plot(density(...)) and then legend(). I've looked at the docs and I'm not sure what I'm doing wrong, if anything. Any advice appreciated.
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"? Uwe Ligges
Thanks, Brian
______________________________________________ R-help at 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
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? Thank you, Brian
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
"Brian" == Brian Hook <hook_l at bookofhook.com>
on Tue, 1 Mar 2005 09:42:46 -0500 writes:
Brian> I'm having a hard time modifying the legend that is
Brian> emitted by default when calling plot(density(...))
Brian> and then legend(). I've looked at the docs and I'm
Brian> not sure what I'm doing wrong, if anything. Any
Brian> advice appreciated.
Brian> ______________________________________________
Brian> R-help at stat.math.ethz.ch mailing list
Brian> https://stat.ethz.ch/mailman/listinfo/r-help
Brian> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
could PLEASE do what the line above asks you to do,
and then re-post your question accordingly?
Thank you,
Martin Maechler, ETH Zurich