# Plot of diplacement field

**URL:** <https://community.freefem.org/t/plot-of-diplacement-field/347>\
**Category:** General Discussion\
**Created:** [April 15, 2020, 12:56pm UTC](https://community.freefem.org/t/plot-of-diplacement-field/347 "2020-04-15T12:56:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Biki](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Biki](https://community.freefem.org/u/Biki)\
**Post date:** [April 15, 2020, 12:56pm UTC](https://community.freefem.org/t/plot-of-diplacement-field/347/1 "2020-04-15T12:56:22Z")

</div>

Hi! I’ll try to explain my problem as briefly as possible. The setting is this:

fespace Vh(Th,[P1,P1]);  
macro u [u0,u1] //  
Vh u;

I find the displacement u as a solution of an elasticity problem. I’ve done the following plot:

plot(Th,[u0,u1], ps=“displ.eps”,wait=false,fill=true);

and the one with the deformed mesh using movemesh, and everything was perfect.  
But I would like to plot the displaced configuration: ruffly speaking, I would like to plot the field defined by x+u(x) instead of the one defined by u(x).  
At every attempt such us plot(Th,[x,y]+[u0,u1],…) (I think this makes no sense, but I don’t know how to do better) the following error occurs:

Compile error : plot of array with wrong number of components (!= 2 or 3)

and I have no idea how to fix the problem and traslate the displacement field. I would be incredibly grateful if someone could help be. Thank you very much!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 15, 2020, 12:59pm UTC](https://community.freefem.org/t/plot-of-diplacement-field/347/2 "2020-04-15T12:59:57Z")

</div>

```auto
mesh Th = square(10, 10);
fespace Vh(Th,[P1,P1]);
macro u [u0,u1] //
macro v [v0,v1] //
Vh u;
Vh v;
v = [u0 + x, u1 + y];

```

---

<div class="post-metadata">

**Author:** ![Biki](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Biki](https://community.freefem.org/u/Biki)\
**Post date:** [April 15, 2020, 1:07pm UTC](https://community.freefem.org/t/plot-of-diplacement-field/347/3 "2020-04-15T13:07:50Z")

</div>

Thank you so much!!!
