Announcement

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

  • Remove extra space after using aspectratio with a graph command

    Hi

    I am using the aspectratio syntax with a graph.

    An example by Nick Cox in his article on the subject demonstrates the problem that I am having:
    Code:
    use http://www.stata-press.com/data/r8/htourism.dta
    tsline mvdays, aspect(0.15) yla(, ang(h))
    How do you remove the excess space above and below the plot? I would like the whole graph area to have roughly the aspect ratio specfied.


    With best wishes and thanks,

    Jane

  • #2
    There is a -margin()- suboption within -graphregion()-, but this needs specification of -ysize()- and -xsize()-.

    Code:
    use http://www.stata-press.com/data/r8/htourism.dta
    tsline mvdays, aspect(.15) xsize(100) ysize(15) yla(, ang(h)) graphregion(margin(0 0 0 0))
    Last edited by Andrew Musau; 20 Mar 2023, 12:59.

    Comment


    • #3
      Thank you, Andrew! That's very helpful. For a little less typing, you can have graphregion(margin(zero)). You get slightly different results if you include aspectratio as well as the xsize and ysize or not.

      Comment

      Working...
      X