[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: -graph hbox- and -graph box-: putting text on the other y axis
Recently I wanted to put text labels on the apparently unused
other y axis of a box plot. The control following from
stuff like -yaxis(1 2)- is not available, as -graph box-
and -graph hbox- are not -twoway- commands. The following
works fine for my purposes. Is there a less devious way
to do this?
My real example involves confidential data, but
the principle can be seen in
. sysuse census
. graph hbox medage, over(region, total) text(34.7 108 "Florida")
subtitle(" ") ysc(r(.,35.5))
The manual explains that for -text(#y #x "text")- the x
axis is scaled from 0 to 100 in the case of a box plot. However,
numbers outside this range can be used (at least in moderation).
A little experiment shows that 108 is a suitable position,
at least with my default font. The -subtitle()- and -ysc()-
calls add extra space above and to the right. With a real subtitle,
you'd probably need to do extra stuff to raise the subtitle text
away from the axis, as recently covered in another thread.
* For searches and help try: