[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Miranda Kim <mk@mrc.soton.ac.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: AW: changing the legend in twoway function |

Date |
Mon, 10 Aug 2009 10:43:44 +0100 |

Martin Weiss wrote:

<>Why not accumulate the thing for a -note- to the graph. Gives you more degrees of freedom re design... ************* clear* inp byte(a b c) 1 3 4 2 5 8 end program define polysameplot foreach i of numlist `0' {local gr /**/ "`gr' function y=a[`i']+b[`i']*x+c[`i']*x^2, range(-5 5) ||"local note /**/ "`note' "a=`=a[`i']', b=`=b[`i']', c=`=c[`i']'""} tw `gr', note(`note') legend(off) end polysameplot 1 2 ************* HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Miranda Kim Gesendet: Montag, 10. August 2009 11:01 An: statalist@hsphsun2.harvard.edu Betreff: st: changing the legend in twoway function Hi, Can anyone help me with this?I am trying to write a program that plots the functions a + bx + cx2 (onthe same graph), where a, b and c are stored variables. I want to labelthe legend with the set of values a, b and c for each graph.For example if I have: a b c 1 3 4 2 5 8then I want to have "a=1, b=3, c=4" and "a=2, b=5, c=8" assigned to therelevant graph in the legend. How can I do this? Also , how complicatedwould it be to control the colours or line types of the graphs?My current program is as follows: program define polysameplot foreach i of numlist `0' {local gr "`gr' function y=a[`i']+b[`i']*x+c[`i']*x^2, range(-55) ||"} twoway `gr' end polysameplot 38 39 40 41 I use Stata 10. Thanks a lot for your help! * * 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/ * * 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/

* * 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/

**References**:**st: changing the legend in twoway function***From:*Miranda Kim <mk@mrc.soton.ac.uk>

**st: AW: changing the legend in twoway function***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: AW: changing the legend in twoway function** - Next by Date:
**st: Average partial effects in gllamm** - Previous by thread:
**st: AW: changing the legend in twoway function** - Next by thread:
**st: AW: AW: changing the legend in twoway function** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |