# How to plot imaginary part of a function

I need to plot the cube root of x in mathematica, but the plot shows me only the real part. I want it to look like wolframalpha plot with both real and imaginary parts of the function. Is it possible to do it?

EDIT:

This is what I want the plot to look like

-
Look e.g. at this post : mathematica.stackexchange.com/questions/3886/…, where I demonstrated ContourPlot approach, or yet another example : mathematica.stackexchange.com/questions/3458/… – Artes May 18 '12 at 23:34

Because M. always takes the principal value of complex numbers, you don't see the values for negative x. You can try ParametricPlot like this:

ParametricPlot[{x^3, x}, {x, -2, 2}]


-

I am probably misunderstanding you but, to see branch cuts and the like, you can do this sort of thing:

GraphicsGrid[
{{Plot3D[Im[(x + I*y)^(1/3)], {x, -5, 5}, {y, -5, 5}],
Plot3D[Re[(x + I*y)^(1/3)], {x, -5, 5}, {y, -5, 5}]}}
]


so there's a branch cut along the negative real axis.

EDIT: In response to comment:

Plot[{Re[x^(1/3)], Im[x^(1/3)]}, {x, -3, 3}]


-
I want to plot 2d functions and I the output should look like this – Alpine May 18 '12 at 22:25
I like the trick you used to draw branch cuts. – Michael Wijaya May 18 '12 at 23:53
For me your after edit picture does not correspond to the result of the Wolfram Alpha query. If you are confident your picture was the result of the query at the time, maybe you can edit the question. I'd say right now this Q&A is in poor shape. – Jacob Akkerboom Aug 28 '13 at 11:37
@JacobAkkerboom I don't remember if there was a discussion about this, or why I put it there. If you find the Q&A poor feel free to contribute a better answer. – acl Aug 29 '13 at 10:05

As of version 9, plotting the cube root function is as simple as:

Plot[CubeRoot[x], {x, -3, 3}]


-