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

Re: st: graph: ytitle position

From   Philip Ryan <>
Subject   Re: st: graph: ytitle position
Date   Thu, 10 Jun 2004 11:13:49 +0930

Another method is to recognise that a title is defined within a textbox, and can take options allowed for the textbox. So we could use the dimensions of the box (which you don't see, by default) to induce the appearance of a gap.


sysuse auto, clear

graph two scatter price mpg, ytitle(, height(1))

graph two scatter price mpg, ytitle(, height(10))

or, bizarrely:

graph two scatter price mpg, ytitle(, height(-5)) xtitle(, height(20))


At 07:51 PM 9/06/2004 -0500, you wrote:

I found something like this will do the trick most of the time:

twoway (scatter y x, sort), ytitle("Y" " ") xtitle("X" " ")

This adds a blank line below the axis title.

Sometimes rotating the axis labels also helps:

twoway (scatter y x, sort), ytitle("Y" " ") xtitle("X" " ") ylabel(, angle(horizontal))

In general, casual empiricism tell me that adding a blank line will work
with any type of title.


On Wed, 9 Jun 2004 wrote:

> Hi,
> Sorry to trouble you, but...
> How do I control ytitle/xtitle position so as to put a little more room
> between the axis and the title?
> In the title command one can use: ti("title", position() ring()), but
> these didn't work with ytitle. _margin_ increased the area to the left of
> the graph, which gave more room, but that isn't what I'm after. And
> finally bm() had no effect I could see.
> Thank you very much for your help.
> Cheers,
> Douglas Crawford
> Ph.D. Candidate, Dept. of Biochemistry
> *
> * For searches and help try:
> *
> *
> *

Dimitriy V. Masterov

Center for Social Program Evaluation
1155 East 60th St. Room 038
Chicago, IL 60637
Work: (773)256-6005
Fax: (773)256-6313

1312 East 53rd St., Apt.309
Chicago, IL 60615
Mobile: (773)220-2760

* For searches and help try:
Philip Ryan
Associate Professor,
Department of Public Health
Associate Dean (Information Technology)
Faculty of Health Sciences
University of Adelaide 5005
South Australia
tel 61 8 8303 3570
fax 61 8 8223 4075
CRICOS Provider Number 00123M
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index