Hello all,

I am seeking to increase the resolution of a graph to 300 dpi for publication. While I've seen solutions that use a third-party software to do so, I'm more interested in learning how to do it by using code in STATA. I stumbled upon this solution (#5), but am having trouble applying it on my Mac. Here is what I have:

Code:
graph set ps pagesize custom
graph set ps mag 300
graph set ps pagewidth 15
graph set ps pageheight 12
graph set ps tmargin 0
graph set ps lmargin 0
graph set ps logo off
graph set ps fontface Helvetica //

*The graph
use "/Users/yuna/Downloads/Data_Figure_3.dta"
graph twoway  (line Coeff SurplusLabor, lcolor(black)) (line CI_low SurplusLabor, lcolor(black) lpattern(dash) ) (line CI_high SurplusLabor, lcolor (black) lpattern(dash)) (line SurplusLaborfrequency SurplusLabor, yaxis(2)) if SurplusLabor>=0&SurplusLabor<=.9, legend(off) ytitle("Effect of Change in China's Export Share") xtitle("Surplus Labor")

*This seems to be where my error is*
/*#delimit ;
 shell /usr/local/bin/gs
         -dSAFER -dBATCH -dNOPAUSE
         -r100 -g1100x800 -sDEVICE=png16m
         -dGraphicsAlphaBits=4 -dTextAlphaBits=4
         -sOutputFile= "figure3.png" "figure3.ps";
This is the error message I receive:

Code:
. #delimit ;
delimiter now ;
.  shell /usr/local/bin/gs
>          -dSAFER -dBATCH -dNOPAUSE
>          -r100 -g1100x800 -sDEVICE=png16m
>          -dGraphicsAlphaBits=4 -dTextAlphaBits=4
>          -sOutputFile= gs "jsa.png" gs "jsa.ps";

GPL Ghostscript 9.21 (2017-03-16)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in (gs)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2
>    %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1
>   %stopped_push
Dictionary stack:
   --dict:1210/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.21: Unrecoverable error, exit code 1
Any idea as to what might be going wrong? I'm new at using ghostscript, so I don't have a full grasp of any syntax errors I might be experiencing