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, 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 <>
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


On Thu, Nov 29, 2012 at 8:31 PM, William Buchanan
<> 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, 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:
*   For searches and help try:

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