1

I'd like to pass functions / expressions into Manipulate[ComplexPlot[...]...] and have Manipulate update some of the values and then update the plot correspondingly.

For instance:

In[161]:= ClearAll[f, n]

In[172]:= f[z_] := z^n

In[174]:= n = 2

Out[174]= 2

In[175]:= f[I]

Out[175]= -1

In[176]:= f[z]

Out[176]= z^2

In[177]:= Manipulate[ ComplexPlot[f[z], {z, -(2 + 2 I), (2 + 2 I)}], {n, 1, 5}]


The above makes a nice colorful plot with a slider to change the value of n, but when I move the sider the plot does not update... [see image below]

OTOH:

Manipulate[ComplexPlot[z^n, {z, -(2 + 2 I), (2 + 2 I)}], {n, 1, 5}]

Makes a nice plot that updates as I move the slider.

But I want to pass in functions to ComplexPlot inside of Manipulate, so that I can define them outside of Manipulate[].

Is there an easy to understand and concise way to do this? One that doesn't involve a lot of deep knowledge of Hold, Evaluate, @, #, etc :-)

Complex plot with slider

0 Answers0