Announcement

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

  • graph export command....misbehaving?

    I often use Stata to create and save graphs. I typically save the *.gph version, and then export to *.emf and *.pdf formats as well. Today, my emf and pdf files don't look exactly like the *.gph versions. The series looks right, but "too many" recessions are showing. Any ideas on why the pdf and emf files are not "exact copies" of the gph version?


    Sample code is here: bgshade stata_qtr,
    twoway
    (
    tsline ECOMPCTSA if year>=1999,
    lwidth(medthick)
    ytitle("")
    ylabel(,angle(0) labsize(small))
    xtitle("")
    xlabel(, labsize(small))
    title("`title1'")
    subtitle("`title2'")
    note("`note1'" "`note2'" "`note3'")
    legend(off)
    ||
    scatter ECOMPCTSA stata_qtr if stata_qtr==tq(`lastqtr_A'),
    msize(vsmall) mlabel(ECOMPCTSA) mcolor(navy) mlabcolor(navy)
    saving(ecommerce1.gph, replace)
    )
    shaders(NBERQ);
    graph export ecommerce1.pdf, replace;
    graph export ecommerce1.emf, replace;

    gph file: ecommerce1.gph
    pdf file: ecommerce1.pdf

  • #2
    If you maximize and minimize the graph window, you will notice that the extra lines are present, so the problem is not due to exporting the graph as PDF. Therefore, the adjustment (if any) should be in your codes.

    Comment


    • #3
      TY, Andrew. Was able to fix via "if" statement to select desired years to display.

      Comment

      Working...
      X