Saving graphs to a specific folder in Mac

Hi,

I was wondering if there is a way I can make Gauss save the graphs files into a specific folder so that I dont need to save one by one.

I am using Gauss 12 for Mac.

Thanks.

3 Answers



0



You can use plotSave to export and save a graph to a particular location. The first input is a string containing the path and name of the file you would like created. You specify the file type you would like it exported to with the file extension, for example:

x = seqa(0.1, 0.1, 30);
plotXY(x, cos(x));
plotSave("/Users/MyUserName/Documents/cos.png", 30|18)

If you are still using some older PQG graphics, then you would use the graphprt command like this:

library pgraph;

x = seqa(0.1, 0.1, 30);
cmd_string = "-c=2 -cf=/Users/MyUserName/Documents/pqg_cos.eps";
graphprt(cmd_string);
xy(x, cos(x));

aptech

1,773


0



Great I will try this. I can use both the new and the old version of the graphics.

However, there is one more thing I am not sure about. The thing goes like this. I have the plot graphics command inside a loop since I plot a different graph for each individual series I have. So the loop only serves to take each time a different column in my matrix and then run the estimation for each one separately.

So if I use just the command to save the graph to the file, it will save each graph one after the other but I wont know afterwards to which one of the series each graph belongs to.

Is there a way that each graph can be named differently when saved?

May be I just want to much, but I rather ask 🙂

Thanks a lot!

 

 

 



0



This works with GAUSS 14 for Mac. I have not had time to try with GAUSS 12. (NOTE: Make sure to change the variable f_path to the name of a directory that exists on your computer.)

x = rndn(100, 1);
y = rndn(100, 1);
string f_name = { "plot_a.jpg", "plot_b.jpg", "plot_c.jpg" };
f_path = "/Users/MyUserName/";
for i(1, 3, 1);
	plotScatter(x, y);
	plotSave(f_path$+f_name[i], 30|18);
endfor;

aptech

1,773

Your Answer

3 Answers

0

You can use plotSave to export and save a graph to a particular location. The first input is a string containing the path and name of the file you would like created. You specify the file type you would like it exported to with the file extension, for example:

x = seqa(0.1, 0.1, 30);
plotXY(x, cos(x));
plotSave("/Users/MyUserName/Documents/cos.png", 30|18)

If you are still using some older PQG graphics, then you would use the graphprt command like this:

library pgraph;

x = seqa(0.1, 0.1, 30);
cmd_string = "-c=2 -cf=/Users/MyUserName/Documents/pqg_cos.eps";
graphprt(cmd_string);
xy(x, cos(x));
0

Great I will try this. I can use both the new and the old version of the graphics.

However, there is one more thing I am not sure about. The thing goes like this. I have the plot graphics command inside a loop since I plot a different graph for each individual series I have. So the loop only serves to take each time a different column in my matrix and then run the estimation for each one separately.

So if I use just the command to save the graph to the file, it will save each graph one after the other but I wont know afterwards to which one of the series each graph belongs to.

Is there a way that each graph can be named differently when saved?

May be I just want to much, but I rather ask 🙂

Thanks a lot!

 

 

 

0

This works with GAUSS 14 for Mac. I have not had time to try with GAUSS 12. (NOTE: Make sure to change the variable f_path to the name of a directory that exists on your computer.)

x = rndn(100, 1);
y = rndn(100, 1);
string f_name = { "plot_a.jpg", "plot_b.jpg", "plot_c.jpg" };
f_path = "/Users/MyUserName/";
for i(1, 3, 1);
	plotScatter(x, y);
	plotSave(f_path$+f_name[i], 30|18);
endfor;

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.