Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Escaping dollar sign in graphs


From   Joly.Patrick@ic.gc.ca
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: RE: Escaping dollar sign in graphs
Date   Mon, 14 Jun 2004 17:50:02 -0400

I realise my earlier email was imprecise.  I am mostly lamenting the
mis-feature (IMO) that labels get evaluated as macros within the internals
of -graph- even though they are not even macros to begin with.  Nor are they
passed as arguments by the user.  Once a label is defined, it should always
continue to be treated as a string literal, i.e. no macro interpolation
should be done.

The SMCL work-around works only in ytitle() or title() options, it doesn't
work when setting variable labels, e.g. 

. la var xrus "{c $|}US per {c $|}CA"

doesn't work the same way.  It is not a serious nuisance but is still
unfortunate; it doesn't reward the overhead of having diligently labelled
one's data.


Patrick Joly  


Nick wrote
> This is indeed a nuisance when you want something 
> different from Stata's treatment here. The cross-reference 
> implied is to the thread started by Phil Ryan on 
> 21 May. See e.g. 
> 
> http://www.hsph.harvard.edu/cgi-bin/lwgate/STATALIST/archives/
> statalist.0405/Author/article-740.html
> 
> The story there is that using the escape character
> works only so far as the next program called, which 
> sees e.g. $US or $CA and misinterprets those 
> as references to global macros. The story there 
> also is that using SMCL provides an  existing 
> work-around. 
> 
> Patrick clearly flagged this as a question 
> for StataCorp, but it would seem 20 years too 
> late to undefine $ as indicating global macros. 
> 
> Possibly StataCorp can define c($) as the dollar 
> symbol as a less cryptic alternative to {c S|} 
> or `=char(36)'. No idea how difficult that would 
> be. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> > -----Original Message-----
> > From: owner-statalist@hsphsun2.harvard.edu
> > [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of
> > Joly.Patrick@ic.gc.ca
> > Sent: 14 June 2004 21:53
> > To: statalist@hsphsun2.harvard.edu
> > Subject: st: Escaping dollar sign in graphs
> > 
> > 
> > This problem came up on the list a few weeks but I would like 
> > to ask Stata
> > whether something can be done about this issue. Specifically, 
> > the problem is
> > that, given a have variable whose label contains a dollar sign say
> > 
> > . la var xrus "\$US per \$CA"
> > 
> > and trying to plot it as either
> > 
> > . twoway line xrus year
> > . twoway line xrus year, ytitle("\$US per \$CA")
> > 
> > causes the currency units to vanish from the y-axis title, 
> > leaving only "
> > per " behind.
> > 
> > This is a bug isn't it?  Or a very unfortunate mis-feature 
> > IMO.  It *should*
> > be possible to print basic ASCII characters set in graphs.  
> > Can something be
> > done about this, this is particularly troublesome for economists.
> > 
> > 
> > Patrick Joly
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> > 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index