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

Re: st: String variable as text labels below x-axis


From   n p <[email protected]>
To   [email protected]
Subject   Re: st: String variable as text labels below x-axis
Date   Thu, 8 Jul 2004 07:19:41 -0700 (PDT)

Thanks Nick,

No it's one course per plot but lots of such plots to
be produced. Anyway, while I was waiting for responses
I tried to find a solution and I ended up with
something that looks similar to your solution (I used
the vtokenize to ... tokenize names)

sum a
local ma=r(max)
sum b 
local mb=r(max)
sum c
local mc=r(max)
vtokenize names

local i=1
while(`i'<=real(r(tokens))){
	gen pos`i'=max(`ma',`mb',`mc')+`i'/4
	local i=`i'+1
	}

sc a b c  Y,xlabel( ,val  ) c(l l l )  || sc pos1
Y,ms(i) mlabpos(0) mlabel(names_1)  xscale(range(0.5
6.5)) /*
*/ || sc pos2 Y,ms(i) mlabpos(0) mlabel(names_2) /*
*/ || sc pos3 Y,ms(i) mlabpos(0) mlabel(names_3) /*
*/ || sc pos4 Y,ms(i) mlabpos(0) mlabel(names_4) /*
*/legend(order(1 2 3) row(1))

The only problem now is that I don't know the number
of instructors a priori thus the number of additional
scatter commands (sc pos* Y) must be manually modified
for each course-dataset-plot. I used the returned
result r(tokens) to generate the positions but I can't
figure out how to deal with the multiple scatter
commands.

Thanks again for your help

Nikos Pantazis
Biostatistician


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
*
*   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