# How to Plot Complex Numbers in Python?

PythonProgramming

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### Practical Machine Learning using Python

Best Seller

91 Lectures 23.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

You can plot complex numbers on a polar plot. If you have an array of complex numbers, you can plot it using:

import matplotlib.pyplot as plt
import numpy as np

cnums = np.arange(5) + 1j * np.arange(6,11)
X = [x.real for x in cnums]
Y = [x.imag for x in cnums]
plt.scatter(X,Y, color='red')
plt.show()

This will plot a graph of the numbers in a complex plane.

Updated on 18-Jun-2020 06:38:34