Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Ang: Re: Ang: Re: st: Legend with rows and columns in a line graph

 From Tomas Lind To statalist@hsphsun2.harvard.edu Subject Ang: Re: Ang: Re: st: Legend with rows and columns in a line graph Date Tue, 5 Feb 2013 09:19:38 +0100

```Thanks Nick Winter and Nick Cox,

for your kind help and explanations.

Many thanks
/Tomas

-----owner-statalist@hsphsun2.harvard.edu skrev: -----
Till: statalist@hsphsun2.harvard.edu
Från: Nick Winter
Sänt av: owner-statalist@hsphsun2.harvard.edu
Datum: 2013-02-04 18:12
Ärende: Re: Ang: Re: st: Legend with rows and columns in a line graph

By default, Stata counts the positions from left to right, top to bottom
(like reading in English).  So position two, in a three-column array, is
the top-middle, position three is the top-right.  Then the markers fill
in from there.

the -colfirst- option tells state to count down then across, so you
could use

... legend( hole(4 6 7) cols(3) colfirst)

Note that this reordered the series.

- Nick

On 2/4/2013 11:18 AM, Tomas Lind wrote:
> Yeas, it works!
>
> How can I understand the logic behind hole(2 3)?
> To me it looks like there is a hole in position 2 and 3 on row 1
> and the same in row 3?
>
> /Tomas
>
>
>
> -----owner-statalist@hsphsun2.harvard.edu skrev: -----
> Till: statalist@hsphsun2.harvard.edu
> Från: Nick Winter
> Sänt av: owner-statalist@hsphsun2.harvard.edu
> Datum: 2013-02-04 17:09
> Ärende: Re: st: Legend with rows and columns in a line graph
>
> This does it for me:
>
>    ... , legend(cols(3) hole(2 3))
>
> - Nick Winter
>
>
> On 2/4/2013 10:12 AM, Tomas Lind wrote:
>> Hi all,
>>
>> Legend in a twoway line graph
>>
>> I´m making a line graph with 5 lines (5 variables).
>> I would like the legend to show the items with 3 rows
>> and 3 columns, see illustration below.
>> I´m trying desperately with -" " and holes(2) etcetera
>> but I can´t make it.
>>
>>
>> The --- is my illustration for the lines that Stata produces
>>
>>
>> --- Mean A
>> --- Mean B   --- B CI lower  --- B CI upper
>> --- Mean C
>>
>>
>> I´m running Stata SE 11.1 on Windows
>>
>>
>>
>> /Tomas
>>
>> Tomas Lind
>> Stockholm Sweden
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```