# Plot function does't work in a loop

**URL:** <https://community.freefem.org/t/plot-function-doest-work-in-a-loop/1356>\
**Category:** General Discussion\
**Created:** [November 27, 2021, 11:23am UTC](https://community.freefem.org/t/plot-function-doest-work-in-a-loop/1356 "2021-11-27T11:23:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lizemin5235](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/lizemin5235/32/857_2.png) [@lizemin5235](https://community.freefem.org/u/lizemin5235)\
**Post date:** [November 27, 2021, 11:23am UTC](https://community.freefem.org/t/plot-function-doest-work-in-a-loop/1356/1 "2021-11-27T11:23:42Z")

</div>

I need to generate the train data used by the mechine learning, When I use random() function to build the vary domain, the output of the plot function does’t work, edp code is list as follow:  
int index =0;  
int NCount=10;  
for(int i=0;i\<NCount;++i)  
{  
index++;  
real cx= randreal3();  
real cy= randreal3();  
real radius = randreal3();  
if(radius \<0.2) continue;  
cout \<\<“Round 1-\>”\<\<“cx:”\<\<cx\<\<“cy:”\<\<cy\<\<“radius:”\<\<radius\<\<endl;  
border Circle(t=0,2_pi) { x = cx+radius_cos(t); y=cy+radius\*sin(t); label=1;}  
plot(Circle(20),ps= “test” + index + “.eps”);  
}  
It’s always the same eps image from the second. I don’t know why, many thanks for help!
