# Plot solutions functions of (x,y,t)

**URL:** <https://community.freefem.org/t/plot-solutions-functions-of-x-y-t/1048>\
**Category:** General Discussion\
**Created:** [June 18, 2021, 11:28am UTC](https://community.freefem.org/t/plot-solutions-functions-of-x-y-t/1048 "2021-06-18T11:28:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aicha](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Aicha](https://community.freefem.org/u/Aicha)\
**Post date:** [June 18, 2021, 11:28am UTC](https://community.freefem.org/t/plot-solutions-functions-of-x-y-t/1048/1 "2021-06-18T11:28:17Z")

</div>

Hi!

I have this example in 1D and my question is what are the changes we have to do in 2D when mesh Th = square(N,N,[L_x,H_y]);? Please

```auto
meshL Th=segment(Nbx,[x*L,0.]);
int it,itsave;
int Thnv = Th.nv;
fespace Vh(Th,P1);
Vh Vs=x,Is=x,Us=x;
real[int,int] Usave(Thnv,1);
Vsave(:,itsave)=Vs[];
for (real t=0;t<T;t+=dt)1{
 if(!(it%max(1.,1./dt))){
      Vs=V;
      itsave++;
      Usave(:,itsave)=Vs[];
      Usave.resize(Thnv,itsave+1);
   }
   if(!(it%(max(1.,1./dt/2.)))){
      real Vmax,Vmin;
      Vs=V;
      Vmax=Vs[].max; Vmin=Vs[].min;
      Vs[]=Vs[]/Vmax;
      meshL ThmvV=movemesh(Th,[x/L,y+Vs]);/
      plot(ThmvV,dim=2,wait=0,cmm="time: "+t+",V min = "+Vmin+", V max = "+Vmax+");
  }
ofstream foutV("v.txt");
for(int m=0;m<Th.nv;m++) {
   for(int n=0;n<itsave;n++) {
      foutV << Vsave(m,n) << " ";
   }
   foutV<<endl;
}

```
