Announcement

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

  • Square graphs-- placement of axes

    Hello,

    I'm trying to make a square graph in Stata. When I use the aspectratio(1) option, the graph becomes square but the placement of the y-axis remains the same and so there's a gap between the plot region and the axis. How can I correct this? Also is there a way to change the aspect ratio of the graph region to 1 as well?

    Code:
        #d ;
        twoway scatter supplyold_grid_end supply_grid_end || lfit supplyold_grid_end supply_grid_end 
        if !missing(supply_grid_end) & !missing(supplyold_grid_end),
        ti("Admin Supply Data vs. Survey Responses on Hours of Supply", size(med)) legend(off) 
        xtitle("Feeder Supply Data", size(small)) 
        ytitle("Survey Supply Response", size(small)) 
        plotregion(lcolor(black) lwidth(thin)) scheme(s2mono) 
        graphregion(color(white)) aspectratio(1) ;
        #d cr
    Thanks,
    Mihir
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	127.8 KB
ID:	1454069




  • #2
    This is being caused by the title. Make it smaller or over two lines:
    Code:
     ti("Admin Supply Data vs." "Survey Responses on Hours of Supply", size(med))

    Comment


    • #3
      Thanks, Scott- that works. Any suggestion on how I can get rid of the excess white space in the graph-region?

      Comment


      • #4
        I would try zero margins within the graph region and set the x and y size to be equal:

        Code:
         graphregion(color(white) margin(zero))  xsize(5) ysize(5)

        Comment

        Working...
        X