Statalist


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

st: RE: Re: legend for reference lines


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: legend for reference lines
Date   Sun, 20 Dec 2009 00:11:09 +0100

<>

" I guess I'll play around with pointing arrows"



Here is an imperfect attempt, unsuitable for mass production:


*******
sysuse auto, clear

tw (kdensity mpg) (pcarrowi 0 16.1 .08 16.1, msize(zero)) /* 
 */ (pcarrowi 0 22.22 0.08 22.22, lpattern(dash) msize(zero))  /* 
 */ (pcarrowi 0 28.33 .08 28.33, lpattern(dash_dot_dot) msize(zero)),  /* 
 */ legend(order(1 "mpg density" 2 "16.1" 3 "22.22" 4 "28.33"))
*******


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert Duval
Sent: Samstag, 19. Dezember 2009 23:52
To: [email protected]
Subject: st: Re: legend for reference lines

I thank both Maarten and Alan for the solutions they proposed.
However, I need to avoid inserting texts by the axes.

The problem is that my reference lines are close enough to make the
label texts illegible, even if I were to send one of them to the top
axis as suggested.

This was indeed the original reason for me looking for a solution
involving legends (which allow much more flexible texts).

I guess I'll play around with pointing arrows and texts inserted at
arbitrary places in the graph, however, if anyone has a solution
involving legends it will be much appreciated.

greetings and thanks again,
robert

On Sat, Dec 19, 2009 at 12:48 AM, Robert Duval <[email protected]> wrote:
> Dear friends,
>
> I have a graph with several vertical reference lines (i.e. xline(#1 #2
> etc)) each with different line pattern styles. Is there a way to
> create a legend to indicate what each reference line means ?
>
> My command is
>
> kdensity var , xline(6.1,lp(solid)) xline(12.22,lp(dash)) xline(18.33,
> lp(shortdash))
>
> Any help will be greatly appreciated
> robert
>
*
*   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/



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