# Representaion d'une fonction

**URL:** https://community.freefem.org/t/representaion-dune-fonction/2547
**Category:** General Discussion
**Created:** [June 17, 2023, 11:26am UTC](https://community.freefem.org/t/representaion-dune-fonction/2547 "2023-06-17T11:26:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Leonidas](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@Leonidas](https://community.freefem.org/u/Leonidas)
#### Post date: [June 17, 2023, 11:26am UTC](https://community.freefem.org/t/representaion-dune-fonction/2547/1 "2023-06-17T11:26:31Z")

</div>

Bonjour, J’aimerai savoir comment représenter une fonction f(x) en fonction de x dans Freefem?

Pour une fonction dépendant de deux variables f(x, t) comment représenter cette fonction f en fonction de x et de t ?  
Merci d’avance, pour votre attention.  
Cordialement !

---

<div class="post-metadata">

### Author: ![m.lbolok](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@m.lbolok](https://community.freefem.org/u/m.lbolok)
#### Post date: [June 17, 2023, 7:31pm UTC](https://community.freefem.org/t/representaion-dune-fonction/2547/2 "2023-06-17T19:31:10Z")

</div>

Hi,  
I have translated your passage through google translate and my answer might not be the thing you required. By the way, defining a function is as follows:

func real f(real x,real t)  
{  
real temp=x+t;  
return temp;  
}  
cout\<\<f(2,3)\<\<endl;

Hope it helps you.

---

<div class="post-metadata">

### Author: ![Leonidas](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@Leonidas](https://community.freefem.org/u/Leonidas)
#### Post date: [June 20, 2023, 3:46pm UTC](https://community.freefem.org/t/representaion-dune-fonction/2547/3 "2023-06-20T15:46:03Z")

</div>

Good evening,

How do you plot a function f dependent on two variable x and t with the help of variable x only on Freefem?

How do you plot a function f(x,y) with the help of variable x and y on Freefem?

Thank you for everything; thank you

---

<div class="post-metadata">

### Author: ![jbl](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jbl](https://community.freefem.org/u/jbl)
#### Post date: [June 21, 2023, 7:06am UTC](https://community.freefem.org/t/representaion-dune-fonction/2547/4 "2023-06-21T07:06:45Z")

</div>

Hello,

Can you be more specific about what kind of plot you want?

In answer to your second question, here’s a code to plot a function f(x,y).

```auto
int L = 20;
int H = 10;

int nn = 2;
int nnL = nn*L;
int nnH = nn*H;
mesh Th = square(L,H,[x*nnL,y*nnH]);

func Myfunc = x+y;
fespace SpaceP1(Th,P1);

SpaceP1 u0 = Myfunc;

plot(u0,value = true,wait = true, fill = true);

```

Are you satisfied with the plot obtained ?
