Announcement

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

  • Nodraw option and .png - can I have both?

    I would like to suppress pop-ups when I draw graphs. I hear the nodraw option can do this. I would also like to save in .png but here's the rub: nodraw only works with option saving(filename). This defaults to gph. If I try saving(filename.png), the file is corrupted. Same with anything other than .gph. So it appears I can either use nodraw and deal with .gph down the road. Or deal with the pop-ups now and use gr export (filename.png). I like gr export except that I can't seem to use it with nodraw. But the goal is to be able to employ nodraw AND png. Is this possible? Thanks!

  • #2
    Well, maybe somebody else will come up with a way to do precisely what you're asking for. The closest thing I can think of is to cover up the Graph window. You will see the Graph window show up briefly, but then the Results window will come forward and obscure it.

    Code:
    clear*
    sysuse auto, clear
    graph twoway scatter mpg price
    graph export scatter.png, replace
    window manage forward results

    Comment


    • #3
      Hi,

      Did you find another solution to this problem? It is annoying when generating many graphs to have to stop working because you get pop-up window... That would deserve a fix in my view

      Comment


      • #4
        You can run Stata in batch mode in the background. If you a do-file (in this case batch.do) that generates the graphs and exports them, then in Windows from the command prompt you could:
        Code:
        C:\Users\scott\Desktop\temp>"C:\Program Files\Stata16\StataMP-64.exe" /e do "C:\Users\scott\Desktop\temp\batch"
        See: https://www.stata.com/manuals/gswb.pdf

        Comment

        Working...
        X