Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: RE: Special character in a plot's legend


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: RE: Special character in a plot's legend
Date   Wed, 24 Jan 2007 09:09:14 -0500

I just wanted to add to this by repeating a little code I posted last month to address this issue of special characters that makes it quite simple to find the ASCII code for the character you want and doesn't require changing the results window font to match the graph window font.

set obs 223
gen asciin=_n+32
gen ascii=char(asciin)
gen x=int(asciin/10)
gen y=asciin-10*int(asciin/10)
tw scatter y x , mlab(ascii) mlabpos(0) mlabsize(large) ///
msymbol(i) yscale(range(-.5 9.5)) ylab(0(1)9,g angle(hor)) ///
xlab(3(1)25,grid) xti("First Digit(s) of ASCII Code") ///
yti("Last Digit") xsize(6) ysize(4) plotregion(margin(medium))
graph save asciiplot

This will give you a graph that shows each character in the current *graph* font and lets you easily see its ASCII code based on the x and y axis values. Note: make sure that the graph command hasn't wrapped strangely in your email -- it should be four lines long with the first three lines each ending in ///.

Michael Blasnik

----- Original Message ----- From: "Nick Cox" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 24, 2007 8:20 AM
Subject: st: RE: Special character in a plot's legend



What's available to you is visible by setting the font
to that you want to use and displaying all possible characters

forval i = 1/256 {
di "`i' " char(`i')
}

Your first method should work in general (local sigma =, etc.).

"`char(228)'" will never work. You need to try "`= char(228)'".

Nick
[email protected]

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index