Statalist


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

Re: st: placing -xtitle- in a specific location in relation to the scale of the x-axis


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: placing -xtitle- in a specific location in relation to the scale of the x-axis
Date   Mon, 4 May 2009 07:42:52 -0500

On Sun, May 3, 2009 at 11:03 AM, Jacob Wegelin <jwegelin@vcu.edu> wrote:
> Is there a way to specify the horizontal location of the -xtitle- in
> relation to the scale of the x-axis?
>

You can use the -margin()- option within -xtitle()-:

sysuse auto, clear
qui summarize mpg, detail
local thisQ1=r(p25)
local thisQ3=r(p75)
local xtitlelocation= (`thisQ1'+`thisQ3')/2
di `xtitlelocation'
sort mpg
kdensity mpg , gen(dnsMPGx dnsMPGy) nograph
set scheme lean1

twoway (line dnsMPGy dnsMPGx), xlabel(none, nogrid noticks labsize(large)) ///
  xmlabel(`thisQ1' `thisQ3', grid glpattern(dash) labsize(medium)) ///
  plotregion(margin(zero)) ///
  title("") ytitle("") ylabel(none)  xtitle(Miles Per Gallon, margin(l=-43))

Scott
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index