x = [[(1+2j) ,(2+8j), (4+1j), (6+8j), (7+3j), (8+2j)],
[(3+8j), (5+1j), (7+5j), (3+2j), (6+1j), (3+1j)],
[(1+5j), (5+4j), (2+9j), (9+5j), (8+1j), (4+1j)]]
I have a complex numpy array and I want to plot it with matplotlib.
t = np.linspace(0, 2700, 2700)
plt.plot(t,x[0])
plt.xlabel('Range')
plt.ylabel('I+jQ')
plt.xlim([0, 2700])
plt.show()
When I run this code I get a failure like this:
/home/user/.local/lib/python3.8/site-packages/numpy/core/_asarray.py:102: ComplexWarning: Casting complex values to real discards the imaginary part
return array(a, dtype, copy=False, order=order)
I mean when I run this code I get a plot but this code draw only real part.
t, Re(number) and Im(number)
in three dimensions?1+2j
, not1+j2
.y
value has 2 numbers, thea
andb
. We don't know what you to show in 2d.