Statalist


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

Re: st: Special character


From   "Tom Trikalinos" <[email protected]>
To   [email protected]
Subject   Re: st: Special character
Date   Wed, 6 Feb 2008 13:05:52 -0500

As a relevant addition:
Once upon a time M. Blasnik posted some code, which I saved into a
"characters.ado" file fro my own use.
running this program results in a self explanatory graph that shows
you which symbol corresponds to which ascii value.  Different fonts or
different platforms have different mappings for some symbols.

You may find some use for it as I did.

tom


/**** BEGIN CODE ****/


*! version 0.1 1Mar2007
*! based on M. Blasnik post to Statalist
*! tat - [email protected]


program define characters
	version 8
	syntax [, Name(string) Export(string) REPLACE ]

	preserve
	clear
	qui set obs 223
	gen asciin=_n+32
	gen ascii=char(asciin)
	gen x=int(asciin/10)
	gen y=asciin-10*int(asciin/10)
	graph twoway 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)) ///
		note("TAT & MB")
	
	if `"`export'"'!="" {
		graph export `export' , `replace'
	}

	if `"`name'"'!="" {
		cap graph drop
		graph rename `name'
	}


	restore

end


/**** END CODE ****/


2008/2/6 Sergiy Radyakin <[email protected]>:
> Technically the character "" is not a part of ASCII, but the codes
> you are looking for are 242 and 243, and they have different meanings,
> depending on the font being used. Codes after 127 are different
> depending on the codepage, so your program might produce different
> output on different computers.
> 242 and 243 are rendered as you wish with the Terminal font on Windows.
>
> Also see the "Character Map" application, which was is with Windows
> (since version 1.03???) for the codes.
>
> Is there any way to change the font in the output window from the program?
>
> Best,
>    Sergiy Radyakin
>
>
> On 2/6/08, Maarten buis <[email protected]> wrote:
> > --  "Julien D." wrote:
> > > I am using Kaplan Meier (sts graph) with risktable instruction like
> > > this...
> > >
> > >  risktable ( ,order( 1  "< 10" 2 ">= 10"  ))
> > >
> > > and I would like to display in the graphic table a "�" symbol
> > > instead of
> > > ">="..
> > >
> > > I tried the method `=char(XXX)' but I m not sur that this character
> > > exist in ASCII...
> >
> > I have no idea what the "�" symbol is, but you can get a list of all
> > ascii characters with -asciiplot- downloadable from -ssc- (in Stata
> > type -ssc describe asciiplot- and -ssc install asciiplot-)
> >
> > Hope this helps,
> > Maarten
> >
> > -----------------------------------------
> > Maarten L. Buis
> > Department of Social Research Methodology
> > Vrije Universiteit Amsterdam
> > Boelelaan 1081
> > 1081 HV Amsterdam
> > The Netherlands
> >
> > visiting address:
> > Buitenveldertselaan 3 (Metropolitan), room Z434
> >
> > +31 20 5986715
> >
> > http://home.fsw.vu.nl/m.buis/
> > -----------------------------------------
> >
> >
> >      __________________________________________________________
> > Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
> >
> > *
> > *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index