Statalist


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

Re: st: rotating text in twoway graphs?


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: rotating text in twoway graphs?
Date   Fri, 15 Jan 2010 08:33:11 +0000 (GMT)

--- On Fri, 15/1/10, Mike Tomz wrote:
> I have a question about using text(text_arg) to add text to
> twoway graphs. I would like to rotate the text such that it
> displays at a desired angle, e.g., 30 degrees. The
> orientation() option allows only four orientation styles --
> horizontal, vertical, rhorizontal, rvertical -- and thus
> does not seem to offer the flexibility to rotate text to an
> arbitrary angle. Is there a way of controlling the exact
> angle of rotation?

You can recreate the functionality of the -text- option by
overlaying a -scatteri- graph over your current graph. You'll
need to specify the -msymbol(i)- option to suppress the 
symbol and only display the text and the legend() option to
suppress any reference to that -scatteri- graph in the legend. 
The advantage is that that allows the -mlabangle()- option 
that you are looking for.

*--------- begin example -----------
sysuse nlsw88, clear
twoway scatter grade age ||     ///
       scatteri 5 40 "foo bar", /// 
       msymbol(i) mlabpos(0)    ///
       legend(off)              ///
       mlabangle(30) 
*--------- end example --------------
( For more on how to use examples I sent to statalist see:
 http://www.maartenbuis.nl/stata/exampleFAQ.html )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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