I've been using the cplot command from the mpmath library to plot a complex function. It works pretty easily, all I have to do is write cplot(G_fit, [0.001, v_max], [-v_max, v_max], points = 100000)
and I get a fairly smooth graph of my function G_fit
over 0.001 < Re(z) < v_max
and -v_max < Im(y) < v_max
. There are two problems though:
How do I add a legend? It says in the documentation that the magnitude of the function is represented by brightness and the phase angle is the hue. That's fine, but what are the magnitudes and hues? All I want to do is add a bar beside the graph that goes from black to white and gives numerical values for the magnitudes at those brightnesses.
Is there any way to plot just the magnitudes (ie. just brightness?)
Thanks, and sorry if this is trivial, but I couldn't find anything about this in the documentation.
My own research finds that:
Doesn't look like it.
Redefine your function to return the absolute value of its argument.