Page 1 of 1
Overwriting graph file?
Posted: Tue Oct 30, 2012 9:17 am
by paues
Is there some option to the graph type command .save that ensures that graph files are overwritten? I would like the code below to yield a graph where tmp=2 and not, as the code is written now, tmp=1. Also, it would be nice to be prompted that the file already exists.
Code: Select all
close @all
wfcreate a 1900 1905
series tmp=1
graph test.line tmp
test.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test
series tmp=2
test.save(t=png,u=pixels,w=600,h=400,c,o) c:\temp\test
Re: Overwriting graph file?
Posted: Tue Oct 30, 2012 1:11 pm
by EViews Gareth
I'm not sure I follow. Your program only creates one graph object, then saves that graph object twice. Since the graph object has not changed, the file on disk does not change.
Re: Overwriting graph file?
Posted: Wed Oct 31, 2012 1:34 am
by paues
As the graphed series tmp change, the graph containing that series also changes. However, the saved file does not change.
But flawed or not, my code was just an example. The question remains: can I make the save command overwrite an existing file?
Re: Overwriting graph file?
Posted: Wed Oct 31, 2012 7:56 am
by EViews Gareth
Well, my point was that that is exactly what the save command does. In fact, I don't believe there is a way to stop it from overwriting the file on disk.
Take this example:
Code: Select all
create u 100
series y=3
freeze(g1) y.line
series x=6
freeze(g2) x.line
g1.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test
g2.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test
You'll notice that the resultant file is a graph of X, not Y.
Re: Overwriting graph file?
Posted: Wed Oct 31, 2012 8:12 am
by paues
Thank you for straightening that out.