This code works for my 3d graph.

But when I turn it into a function for an @interact, it does not work anymore.

How can I fix this? Thanks.

1 | initial version |

This code works for my 3d graph.

But when I turn it into a function for an @interact, it does not work anymore.

How can I fix this? Thanks.

This code works for my 3d graph.

But when I turn it into a function for an @interact, it does not work anymore.

How can I fix this? Thanks.

Edit: here is the code:

```
x, y, z = var('x, y, z')
@interact
def graphe(f = input_box(default=cos(y), label="$f(x,y)$"), r = input_box(default=10, label="$r$")):
f(x,y) = f
G = implicit_plot3d(z==f(x,y), (x, -r, r), (y, -r, r), (z, -r, r), plot_points=30, color='orange', mesh=1, opacity=.7)
show(G, spin=1)
```

This code works for my 3d graph.

But when I turn it into a function for an @interact, it does not work anymore.

How can I fix this? Thanks.

Edit: here is the code:

```
x, y, z = var('x, y, z')
@interact
def graphe(f = input_box(default=cos(y), label="$f(x,y)$"), r = input_box(default=10, label="$r$")):
```~~f(x,y) = f
~~G = implicit_plot3d(z==f(x,y), (x, -r, r), (y, -r, r), (z, -r, r), plot_points=30, color='orange', mesh=1, opacity=.7)
show(G, spin=1)

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.