Bookmark and Share

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.


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

Re: st: Labeling series within the plot area


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Labeling series within the plot area
Date   Fri, 30 Nov 2012 00:51:35 +0000

Another technique is to use marker labels on the last value in a time series.

webuse grunfeld

xtline invest, overlay ysc(log)

The legend is a problem. It takes up too much space.

xtline invest, overlay ysc(log) ///
addplot(scatter invest year if year == 1954, ms(i) mla(company)
legend(off) mlabcolor(black)) ///
yla(1000 100 10 1, ang(h))

The marker labels by default are at clock position 3 pm, exactly right
for this problem.

With more work, you could get different colours. Naturally, this is
best for short text labels only.

See also

Cox, N.J. 2011. Stata tip 104: Added text and title options. Stata
Journal 11(4):  632-633

Nick

On Thu, Nov 29, 2012 at 8:31 PM, William Buchanan
<william@williambuchanan.net> wrote:

You might want to look at the added-text/text-box options.  It might
take a little bit to get the placement just right, but that would be a
way to do it.

On Nov 29, 2012, at 12:28 PM, Max.Livingston@ny.frb.org wrote:

>> When creating graphs (using a do-file, not the Graph Editor), is there a
>> way to label the data series in the plot area, so the name of the series
>> would appear near the line that is plotted? Here is an example:
>> http://libertystreeteconomics.typepad.com/.a/6a01348793456c970c017d3dfcdf73970c-popup
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index