Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: how to add short labels to line graphs in lieu of a legend?

From   Scott Merryman <>
Subject   Re: st: how to add short labels to line graphs in lieu of a legend?
Date   Fri, 6 Jan 2012 14:19:29 -0600

On Fri, Jan 6, 2012 at 1:00 PM,  <> wrote:
> I have quarterly data for a panel of 6 countries (DE, IE, IT, SE, UK,
> US)  which begin in 2007q1 and run until 2011q3 for 4 countries (DE, SE,
> UK, US), but only to 2011q2 for IE and IT
> I am graphing a variable "index" against time for each country
> separately, and want to add a country marker label to the right of each
> country's series that shows the relevant country's 2-letter acronym
> (held in string var "cty2").  I want the country marker labels to be in
> the same position relative to the horizontal axis -- i.e. all the
> country labels should be vertically aligned, even for the 2 countries
> with shorter series.
> [I currently also identify the separate series using a legend, but I may
> drop that if I can solve my problem.]
> The problem is that I can't get the marker labels shown for IE and IT
> (the 2 countries with shorter series), let alone aligned.

Since you are graphing index on qdate, your dummy data does not
replace the missing qdate values.  Perhaps something like this:

replace qdate =  string(year) + "q"+string(quarter) if qdate == ""
gen date = quarterly(qdate, "YQ")
drop qdate
rename date qdate
format qdate %tq


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index