Announcement

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

  • Blue-gray thin frame when combining graphs

    Hi Everyone,

    I want to combine two graphs using 'gr combine' command. Each individual graph looks as I want but when I combine them, there appears a blue-gray thin frame between and on the corners of the graphs. For illustration, you can find my sample code below.

    sysuse auto.dta, clear
    gen order = _n

    twoway (line price order, ylabel(3000(3000)16000, nogrid labsize(medlarge)) ytitle("Price", size(medlarge)) xtitle("Order", size(medlarge)) xlabel(1(15)74, labsize(medlarge)) title("Figure 1") plotregion(fcolor(white)) graphregion(fcolor(white)) bgcolor(white) text(12000 43 "some text", size(medlarge)) ), saving("price", replace)

    twoway (line price order, ylabel(3000(3000)16000, nogrid labsize(medlarge)) ytitle("Price2", size(medlarge)) xtitle("Order", size(medlarge)) xlabel(1(15)74, labsize(medlarge)) title("Figure 2") plotregion(fcolor(white)) graphregion(fcolor(white)) bgcolor(white) text(12000 43 "some text", size(medlarge)) ), saving("price2", replace)

    gr combine "price.gph" "price2.gph", plotregion(fcolor(white)) graphregion(fcolor(white)) xsize(7.5) ysize(3.5) ycommon title("Combined")



    Could you please help me to remove those lines? Thanks.

    Best,
    Ulas

  • #2
    You can add lcolor(white) in graphregion

    Code:
    sysuse auto.dta, clear
    gen order = _n
    
    set scheme s2color
    
    twoway (line price order, ylabel(3000(3000)16000, nogrid labsize(medlarge)) ytitle("Price", size(medlarge)) xtitle("Order", size(medlarge)) xlabel(1(15)74, labsize(medlarge)) title("Figure 1") plotregion(fcolor(white)) graphregion(fcolor(white) lcolor(white)) bgcolor(white) text(12000 43 "some text", size(medlarge)) ), saving("price", replace)
    
    twoway (line price order, ylabel(3000(3000)16000, nogrid labsize(medlarge)) ytitle("Price2", size(medlarge)) xtitle("Order", size(medlarge)) xlabel(1(15)74, labsize(medlarge)) title("Figure 2") plotregion(fcolor(white)) graphregion(fcolor(white) lcolor(white)) bgcolor(white) text(12000 43 "some text", size(medlarge)) ), saving("price2", replace)
    
    gr combine "price.gph" "price2.gph", plotregion(fcolor(white)) graphregion(fcolor(white)) xsize(7.5) ysize(3.5) ycommon title("Combined")

    Comment


    • #3
      Thanks a lot

      Comment


      • #4
        Hi,
        if I export the combined graph as png or eps and use it in a latex document, it still has a small grey frame. How can I get rid of this?

        Attached Files

        Comment


        • #5
          Perhaps you used the scheme s2color when combining the graphs. Note that you are asked to state your version of Stata if it is not the current version (FAQ Advice #11). Try

          Code:
          set scheme s1color
          graph combine ...

          Comment


          • #6
            Yes, I just copied Justins code above which is with s2color. With s1color I manage to get rid of the grey frame (I use stata version 17 for mac).
            Thanks!

            Comment

            Working...
            X