Ask Your Question

Revision history [back]

Plot real to complex function

I have a function that has real domain and a complex co-domain. I want to plot the real and imaginary parts together, like this: imgur.com/a/yb7g5Ce

The code that I used to generate that plot (plot(real(F(x)),(-2,2)) + plot(imag(F(x)),(-2,2),color="red")) works, but I think every value is being calculated two times, discarding either the real or the imaginary part. Is there any way to get this effect more efficiently, without doing useless calculations?