Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: marginsplot, editing addplot legend entries
From
Scott Merryman <[email protected]>
To
[email protected]
Subject
Re: st: marginsplot, editing addplot legend entries
Date
Wed, 25 Jan 2012 12:30:36 -0600
Here is one way:
sysuse auto, clear
reg price mpg i.foreign
margins foreign, at(mpg=(15(5)35))
marginsplot, addplot(scatter price mpg , ///
legend(order(3 "some" 4 "label" 5 "scatter")))
Scott
On Wed, Jan 25, 2012 at 11:49 AM, Fiedler, James (JSC-SK)[UNIVERSITIES
SPACE RESEARCH ASSOC-DIV OF SPACE LIFE SCIENCES]
<[email protected]> wrote:
> I am sending this message for Rob Ploutz-Snyder, who is having trouble submitting messages to Statalist.
>
> James Fiedler
>
>
> His message:
>
>
> Greetings Statalisters.
>
> I'm having difficulty getting my legend labels to work with -marginsplot, addplot(scatter blahhh)-. No matter what I try I am unable to change the labels in the ADDPLOT portion.
>
> I saw Nick Winter's and Scott Merryman's replies to David Muller's post in November {Subject: st:marginsplot ignores label() sub-option in legend} that recommended:
>
> -marginsplot, plot( , label("some" "label"))- and -marginsplot, legend(order(3 "some" 4 "label"))-
>
>
> I can verify that those indeed change the labels for the marginsplot itself, but I can't seem to make that code alter the labels for whatever was added with the addplot option.
>
> I've tried putting legend(lab()) inside the addplot but it gets ignored. I've tried using the same outside of the addplot() but that doesn't work either. I've tried putting legend options inside the plotopts() and again, no success.
>
> How can we gain control of the legend labels for the addplot portion of marginsplot??
>
> Thanks in advance!
> Rob
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/