# ListPlot of imaginary part

Assuming I have a list like:

{{1, 1. - 0.0169212 I}, {2, 0.99611 + 0.0326189 I},
{3,1.02048 + 0.0945609 I}, {4, 1.02722 + 0.138977 I}}


When I try now

ListPlot[Im[List]]


I got points only on $x=0$, since the imaginary part of all the "$x$-points" is zero. How can I plot what is really meant by the command above? So that only the second entry of the tuple get's the Im.

• 2 things: 1) Call your list list, not List 2) since your x-coords are 1,2,3,4..., list[[All, 2]] // Im // ListPlot will work - otherwise use @AlexeiBoulbitch 's solution Commented Nov 30, 2015 at 11:27
• Take a look at MapAt.
– Kuba
Commented Nov 30, 2015 at 12:12

Try this:

ListPlot[lst /. {x_, y_} -> {x, Im[y]}]


returning this:

Have fun!

Data:

{{1, 1. - 0.0169212 I}, {2, 0.99611 + 0.0326189 I}, {3, 1.02048 + 0.0945609 I}, {4, 1.02722 + 0.138977 I}};


Operation:

ListPlot[Im[%[[All, 2]]]]


Output:

Reference:

w={{1, 1. - 0.0169212 I}, {2, 0.99611 + 0.0326189 I},{3,1.02048 + 0.0945609
I}, {4, 1.02722 + 0.138977 I}};
f[w_] := w /. {a_, b_} :> {a, Im[b]};
list = f@w
ListPlot[list]