[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: -graph bar, over-: problem with string vars and quotes
Many thanks for the suggested solutions for my problem with broken
labels. The -twoway bar- approach is interesting because the
underlying data doesn't have to be modified. Nick's code also doesn't
appear to suffer from an additional problem that I encountered.
Substituting single quotes for all double quotes requires only one
additional line of code. However, the labels are cut off almost
completely (at least in Stata 8.2) if the graph has fewer than 20
bars, as you can see by running the following commands.
sysuse auto, clear
replace make = `""AMC Concord""' if make == "AMC Concord"
replace make = `""AMC" Pacer"' if make == "AMC Pacer"
replace make = `"AMC "Spirit""' if make == "AMC Spirit"
replace make = subinstr(make,`"""',"''",.)
graph hbar mpg if _n<20, over(make)
graph hbar mpg if _n<21, over(make)
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
* For searches and help try: