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]
st: AW: graphs with dates question...
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
st: AW: graphs with dates question...
Date
Fri, 16 Apr 2010 09:44:25 +0200
<>
Ulrich`s code does not lead to success for me, so here is another take on
the problem:
*************
clear*
set obs 10
gen int quarter=190+_n
form quarter %tq
expand 10
gen var1 =rnormal()
collapse (mean) var1, by(quarter)
tw (bar var1 quarter, sort), /*
*/ xlab(#3, angle(forty_five))
*************
The original call -graph bar (mean) Var1, over (Quarter)- could be augmented
by the -relabel()- suboption. The labels to go into it could be produced by
NJC`s -ssc d mylabels-, yet would need to start from _1_, not 191 as in my
example. Hence the approach above, which avoids the -over- option
altogether.
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Asdsa Sdjfkn
Gesendet: Freitag, 16. April 2010 05:45
An: [email protected]
Betreff: st: graphs with dates question...
I want to make a graph with the command:
graph bar (mean) Var1, over (Quarter)
where Quarter is formatted as
%tq. This produces a graph with the number corresponding to the quarter
on the x-axis, rather than the actual quarter (e.g. '0' instead of
'1960q1'). How can I get the quarter to show up rather than the
corresponding number?
I'd also like only, say, one quarter a year to be labelled on the x-axis,
otherwise there isn't enough room for all the text to fit. I've trawled
through the documentation for this, but
haven't found anything useful...
thanks!
*
* 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/