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]

st: RE: Formatting dates on a graph bar label


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Formatting dates on a graph bar label
Date   Fri, 29 Jul 2011 16:41:50 +0100

The best I can suggest is something like 

. graph bar mpg, over(rep78, relabel(1 "1/1/11"))

I was going to say that we need a suboption, namely 

... over(, label(format()))

But you can call up such a suboption; it is just ignored. 

You could -generate- the -over()- variable as a string, but then it wouldn't sort as you would want, e.g. "2/1/11" would sort after "11/1/11"

Nick 
n.j.cox@durham.ac.uk 

u.atz@lse.ac.uk

I feel stuck as my graph always displays the actual Stata numbers for the date no matter how I specify the label.

First I did:

generate datenumber = date(date, "DMY")
format datenumber %td

Then: 

graph hbar v1 v2 v3, over(datenumber)

The label won't change to something like 01/01/2011, no matter how I play around in the graph editor.

Is this enough information (using Stata 11.2)? I reckon it's a simple problem.

Everywhere else the behaviour is as specified in the help file on date and times.


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