Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: graph export; path problem


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: graph export; path problem
Date   Wed, 15 Jan 2014 11:34:50 -0500

Dear Sven, I see two problems with your code:

1) the option replace must be specified outside of the quotes:
saving("$gd/contour_rr2.gph", replace)
not
saving("$gd/contour_rr2.gph, replace")

2) graph export command must be followed by the file name, WITHOUT the
using prefix.

With both fixed, your code should work.
Best, Sergiy Radyakin


On Wed, Jan 15, 2014 at 8:19 AM, Trelle Sven <[email protected]> wrote:
> Dear all,
> I have a problem with the "graph export" command in Stata 12 and hope that = somebody might be able to help (I am not sure whether I asked this question=  before but could not find it in the archive. I know that I had the same pr= oblem in another project. So - I apologize if this question was answered so= me time ago):
>
> I defined the following macros to match the structure of my project folder:
>
> global pp=3D"/Project A/00_Stata" // define path to new project here withou= t drive letter global gd=3D"X:$pp/graphres"
>
> I generate a contour plot and save it with the saving option:
>
> ......, ... saving("$gd/contour_rr2.gph, replace")
>
> This all works fine. Later on in my do-file I have the following code:
>
>                 graph use "$gd/contour_rr2.gph"
>
> This also works fine i.e. the graph window with the graph opens correctly. = But now the problem starts. I want to save this graph as an .emf-file with = the following code:
>
>                 graph export using `"${gd}/contour_rr2.emf"', replace
>
> Stata gives me an error message:
> invalid '"X:/Project A/00_Stata/graphres/contour_rr2.emf'
> r(198);=A8
>
> It seems that there is a problem with the quotes but I have no clue where t= he problem is/how to resolve it ...
> When displaying the path in the graph export command Stata displays the cor= rect path
>                 . dis `"${gd}/contour_rr2.emf"'
> X:/Project A/00_Stata/graphres/contour_rr2.emf
>
> Thanks for any help
> Sven Trelle
>
> p.s. right-clicking on the graph in the graph window to save it as an .emf-= file works without any problems.
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index