Question

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:

  1. 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.

  2. 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.

Was it helpful?

Solution

My own research finds that:

  1. Doesn't look like it.

  2. Redefine your function to return the absolute value of its argument.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top