Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Re: Re: st: placing two textboxes in a graph on the x-axis

From   "Ariel Linden, DrPH" <[email protected]>
To   <[email protected]>
Subject   re: Re: Re: st: placing two textboxes in a graph on the x-axis
Date   Mon, 29 Aug 2011 10:39:21 -0400

As always, Nick, you give perfect solutions. In particular, the tlength(*#)
is valuable, since I was trying to figure out how to "offset" the text from
the axis (as one would use titlegap(#) for a title). 

I was obviously looking in the wrong place in the manual
("added_text_options"). I am hoping to master 25% of what Stata has to offer
before retirement. :-)

Yes, I was referring to the graph recorder. It would be great if the actual
commands used in the graph recorder would be displayed in the viewer, so
that the user could learn what exactly what code is being processed [as
currently occurs when any other command is used from the drop down menu].  

Thanks again for the wonderful, helpful suggestions!


Date: Sun, 28 Aug 2011 17:49:14 +0100
From: Nick Cox <[email protected]>
Subject: Re: Re: st: placing two textboxes in a graph on the x-axis

- -xmlabel()- is documented under -axis label options-. That's where I
would expect. Where did you look?

You can move labels up or down by changing the length of the
corresponding ticks. The objection is then likely to be that long
ticks are not wanted. But when I want extra text I often just use
- -tlcolor(none)- to make the ticks invisible. And although the
- -?mlabel()- are born small they can be made bigger.

So, for putting extra text on graph axes I often use -xmlabel()- or
- -ymlabel()- with long but invisible ticks and a big label size.

. sysuse auto, clear
(1978 Automobile Data)

. scatter mpg weight

. scatter mpg weight, xmla(4500 "4500")

. scatter mpg weight, xmla(4500 "4500", tlength(*3))

. scatter mpg weight, xmla(4500 "4500", tlength(*6))

. scatter mpg weight, xmla(4500 "4500", tlength(*6) tlcolor(none))

. scatter mpg weight, xmla(4500 "4500", tlength(*6) tlcolor(none)

In terms of Ariel's more general comments:

1. Do you mean something other than the Graph Recorder?

2. It seems inevitable that a fat manual documenting a complicated set
of commands is a bit frustrating sometimes. I think StataCorp would
want specifics of what is not documented and what is documented in
puzzling places.


On Sun, Aug 28, 2011 at 5:18 PM, Ariel Linden, DrPH
<[email protected]> wrote:
> Thank you Eric for your additional approach. I actually started out my
> using the text option, however, as you correctly noted, it is not an easy
> task trying to position the boxes (and it changes with every graph)!
> If I could suggest to Stata an addition to a future version, it would be
> "track" the commands used in the graph editor and display them in the same
> way that all other commands are displayed (when using drop down menus
> instead of directly writing in the command at the command line).  There
> many options in graphing that are not intuitive or easy to find in the
> manual (for example, I could not find xmlabel documented anywhere).
> One last question: is there a way to offset the xmlabel downward from the
> x-axis?
> Thanks again for providing very useful advice!
> Ariel

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index