Export multiple eps graphs

How can I export multiple graphs in eps? I run Gauss 12 (12.0.3 build 2560)

The following code exports only one graph. In fact, it exports the second graph in a file which I want to save the first graph in!

new;
library pgraph;  
cls; 
graphset;

@** set global control variables for all graphs ***@ 
_pmcolor = 0|0|0|0|0|0|0|0|15; 
_plwidth = 8; 
_pframe = { 0, 1}; 
_pltype = 6; 
_pcolor = { 12, 10, 1, 11, 7}; 
_pgrid = { 2, 0}; 
_ptitlht = 0.2;
_plegctl = { 2 5 1 1 }; 
_plegstr = "TEST";

let data[20, 2]; let xser[20, 1];

for ii(1,20,1);  
data[ii,1] = 20;  
data[ii,2] = 30;  
xser[ii] = ii; 
endfor;

begwind; 
window(2,1,0); 
for ii(1,2,1);    
   setwind(ii);    
   title("Test1");    
   xy(xser,data[.,ii]); 
endfor; 
cmdstr = "-po=L -C=1 -cf=ucond.eps"; 
graphprt(cmdstr); 
endwind;

begwind; 
window(2,1,0); 
for ii(1,2,1);    
   setwind(ii);    
   title("Test2");    
   xy(xser,data[.,ii]); 
endfor; 
cmdstr = "-po=L -C=1 -cf=ucond2.eps"; 
graphprt(cmdstr); 
endwind;

2 Answers



1



accepted

You should be able to solve your problem by adding:

sleep(0.3);

after you draw your first graph.

Since you are using version 12 you have the new graphics available. They are MUCH easier to use and MUCH nicer to look at. If you have any graphics code that you would like converted to use the new graphics, post it here and we will help generously with that process.

The current version of 12 is 12.1.9 and it has many new features and bug fixes since 12.0.3. If you have a license for 12 you can download it for free.

aptech

1,773


0



This was very helpful. All my graphs basically use code like this:


new; library pgraph; cls; graphset;

@** set global control variables for all graphs ***@
_pmcolor = 0|0|0|0|0|0|0|0|15;
_plwidth = 8;
_pframe = { 0, 1};
_pltype = 6;
_pcolor = { 12, 10, 1, 11, 7};
_pgrid = { 2, 0};
_ptitlht = 0.2;
_plegctl = { 2 5 1 1 };

data1 = rndu(20, 4);
data2 = rndu(20, 4);
data3 = rndu(20, 4);
xser = seqa(1, 1, 20);

let string myTitle = {"Figure 1", "Figure 2", "Figure 3", "Figure 4" };
_plegstr = "Data100Data200Data3";
begwind;
window(2,2,0);
for ii(1,4,1);
setwind(ii);
title(myTitle[ii]);
xy(xser,data1[.,ii]~data2[.,ii]~data3[.,ii]);

endfor;
endwind;

Your Answer

2 Answers

1
accepted

You should be able to solve your problem by adding:

sleep(0.3);

after you draw your first graph.

Since you are using version 12 you have the new graphics available. They are MUCH easier to use and MUCH nicer to look at. If you have any graphics code that you would like converted to use the new graphics, post it here and we will help generously with that process.

The current version of 12 is 12.1.9 and it has many new features and bug fixes since 12.0.3. If you have a license for 12 you can download it for free.

0

This was very helpful. All my graphs basically use code like this:


new; library pgraph; cls; graphset;

@** set global control variables for all graphs ***@
_pmcolor = 0|0|0|0|0|0|0|0|15;
_plwidth = 8;
_pframe = { 0, 1};
_pltype = 6;
_pcolor = { 12, 10, 1, 11, 7};
_pgrid = { 2, 0};
_ptitlht = 0.2;
_plegctl = { 2 5 1 1 };

data1 = rndu(20, 4);
data2 = rndu(20, 4);
data3 = rndu(20, 4);
xser = seqa(1, 1, 20);

let string myTitle = {"Figure 1", "Figure 2", "Figure 3", "Figure 4" };
_plegstr = "Data100Data200Data3";
begwind;
window(2,2,0);
for ii(1,4,1);
setwind(ii);
title(myTitle[ii]);
xy(xser,data1[.,ii]~data2[.,ii]~data3[.,ii]);

endfor;
endwind;


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.