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]

st: AW: graphs with dates question...


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Asdsa Sdjfkn
Gesendet: Freitag, 16. April 2010 05:45
An: statalist@hsphsun2.harvard.edu
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/


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