Bookmark and Share

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


[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 <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
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,  <S.Jenkins@lse.ac.uk> 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

Scott

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index