Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Legend Option


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Legend Option
Date   Sun, 30 Oct 2005 22:07:03 -0000

I am not sure what point you are trying to make here, but if 
you had continued in your reading the answer would have
become apparent. 

In my copy of Stata 9.1 I can find this enormous chunk 
of information in the on-line help. A quick cross-check establishes that
this was also available in Stata 8.2. So, even if no manual 
is available to you, "orderinfo" is explained. 

order(orderinfo) specifies which keys are to appear in the legend and the
        order in which they are to appear.

        order(# # ...) is the usual syntax.  order(1 2 3) would specify that
        key 1 is to appear first in the legend, followed by key 2, followed
        by key 3.  order(1 2 3) is the default if there are three keys.  If
        there were four keys, order(1 2 3 4) would be the default, and so on.
        If there were four keys and you specified order(1 2 3), the fourth
        key would not appear in the legend.  If you specified order(2 1 3),
        first key 2 would appear, followed by key 1, followed by key 3.

        A dash specifies that text be inserted into the legend.  For
        instance, order(1 2 - "text" 3) specifies key 1 appear first,
        followed by key 2, followed by the text text, followed by key 3.
        Imagine that the default key were

                +-------------------+
                |  o   Observed     |
                | ---  linear       |
                | ---  Quadratic    |
                +-------------------+

        Specifying order(1 - "Predicted:" 2 3) would produce

                +-------------------+
                |  o   Observed     |
                |      Predicted:   |
                | ---  linear       |
                | ---  Quadratic    |
                +-------------------+

        and specifying order(1 - " " "Predicted:" 2 3) would produce

                +-------------------+
                |  o   Observed     |
                |                   |
                |      Predicted:   |
                | ---  linear       |
                | ---  Quadratic    |
                +-------------------+

        Note carefully the specification of a blank for the first line of the
        text insertion; we typed " " and not "".  Typing "" would insert
        nothing.

        You may also specify quoted text after # to override the descriptive
        text associated with a symbol.  Specifying order(1 "Observed 1992" -
        " " "Predicted" 2 3) would change "Observed" in the above to
        "Observed 1992".  It is considered better style, however, to use the
        label() suboption to relabel symbols.

Nick 
[email protected] 

Raphael Fraser
 
> you mean "order(orderinfo)". Easy for you to say Nick. I wasn't clear
> what was orderinfo and had no examples to work with. May be if it had
> said order#, I would have figured it out.
> 
> On 10/30/05, Nick Cox <[email protected]> wrote:
> > This is clearly indicated in the help.
> > For example, use -legend(order(3 4))- to
> > show only the 3rd and 4th response variables.
> >
> > In your case, this could be combined with
> > your existing syntax something like this:
> >
> > legend(order(3 "AA" 4 "SS") pos(10) ring(0))
> >
> > Nick
> > [email protected]
> >
> > Raphael Fraser
> >
> > > I have the following graph in Stata 8.2:
> > >
> > > twoway (rcap ub lb ragey if geno==1)|| ///
> > >             (rcap ub lb ragey if geno==2)|| ///
> > >             (scatter p ragey if geno==1, msymbol(O) connect(l)
> > > clp(longdash_dot)) || ///
> > >             (scatter p ragey if geno==2, msymbol(O) 
> connect(l))||, ///
> > >         ti("Prevalence (%)") xmtick(10(1)25) ymtick(0(5)50)
> > > yla(,angle(0))
> > > xti("Age (in years)") ///
> > >         legend(label(3 "AA") label(4 "SS") pos(10) ring(0))
> > >
> > > As a result Stata produces four variables in the legend. 
> I wish only
> > > to keep two of the four variables in the legend. How can 
> this be done?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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