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: level and distribution plot side by side
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: level and distribution plot side by side
Date
Sun, 6 Jan 2013 21:04:04 +0000
That line
local vallabel = `"`vallabel'`y' "10{superscript:`x'}" "'
would be better stripped of the = sign. It probably won't bite you
here, but it is bad style. See
SJ-8-4 pr0045 . . . . . . . . Stata tip 70: Beware the evaluating equal sign
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
Q4/08 SJ 8(4):586--587 (no commands)
tip explaining the pitfall of losing content in a macro
because of limits on the length of string expressions
http://www.stata-journal.com/sjpdf.html?articlenum=pr0045
On Sun, Jan 6, 2013 at 7:39 PM, annoporci <[email protected]> wrote:
>
>>> Is there a simple way to have the powers of 10 printed as
>>> superscripts rather than as a caret(^)?
>
>
>> Yes; Rense refers to it in the blog entry you cited.
>> Use {sup:#} as explained in -help text- and
>>
>> http://www.stata.com/help.cgi?text
>>
>> Nick
>
>
> Excellent, thanks.
>
> Rense writes "the superscripts end up too far from the other characters" but
> I have not found that, it looks just right for me, perhaps we use different
> fonts or different font sizes:
>
> http://www1.picturepush.com/photo/a/11892364/img/11892364.jpg
>
> For the record, here is the amended code for powers of 10:
>
> local vallabel = ""
>
> forval x = `expmin'(`expstp')`expmax'{
> local y = 10^`x'
> local vallabel = `"`vallabel'`y' "10{superscript:`x'}" "'
> }
>
> where one previously defines, say:
>
> local expmin = 2
> local expstp = 1
> local expmax = 7
>
> The rest of the code is as posted on Rense's blog.
>
>
> --
> Patrick Toche.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/