Statalist


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

st: RE: rcap graph: forcing labels for all x-axis values


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: rcap graph: forcing labels for all x-axis values
Date   Wed, 2 Apr 2008 18:06:01 +0100

Some technique: 

. sysuse auto, clear
(1978 Automobile Data)

. label def rep78 1 lousy 2 poor 3 mediocre 4 good 5 spectacular

. label val rep78 rep78 

. levelsof rep78, local(levels)
1 2 3 4 5

. scatter mpg rep78, xla(`levels', valuelabel)

The important bit here is 

levelsof ..., local(levels) 
..., xla(`levels', valuelabel) 

Nick 
[email protected] 

Leif Peterson

Is there a way to force the "skip factor" for x-axis labels on the rcap 
graph to zero, so that every x-axis value is plotted?   I have about 20 
records containing high-low-close data and need every value label to be 
plotted on the x-axis.  (The unique x-values range from 1,2,...,20, and 
the y-values reflect high-low-close.) 

As a workaround to the above, I programmatically concatenated an xlabel 
string but have only been successful in generating (e.g.):

1GM 2Ford 3Chrysler

when I really need:

1 "GM" 2 "Ford" 3 "Chrysler"

At run-time, the integers in my string are from `i' and the value labels

"`w'" are actually variable names defined by

local w : word `i' in `varnames'


*
*   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