Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove margin below X-title

    Hi Statalist,

    I need to embed a local polynomial graph inside a LaTeX document. In order to keep the proportions between this graph and other objects on my LaTeX slide nice, I want to remove all of the margin below the x-axis title on my graph. I have played around with graphregion(margin(..)) and xti(..., margin(...)) in the following way to try to make this blank space disappear:

    Code:
    sysuse auto.dta, clear 
    
    lpoly price mpg, scheme(s1mono) yti("Price", margin(zero) size(large)) xti("Miles per Gallon", margin(l=0 r=0 t=3 b=0) size(large)) note(" ") ///
    msize(tiny) mcol(gs13) lineop(lcol(midblue) lpat(solid)) graphregion(margin(zero)) title(" ", margin(zero))
    
    graph export "your/path/temp.png", replace
    As you can see in the attached .png file, there is still substantial space below the x title. I have read the documentation related to the graphregion option and am stumped as to what could be causing this extra space. Any help would be appreciated.

    Thanks much,

    Julian
    Attached Files

  • #2
    Try adjusting the xtitle margin using:
    Code:
    ... xti("Miles per Gallon", margin(l=0 r=0 t=3 b-5) ...

    Comment


    • #3
      Works perfectly, thanks Scott.

      Comment

      Working...
      X