name 'plt' is not defined 1

name ‘plt’ is not defined

%matplotlib ipympl

import matplotlib.pyplot as plt

a_x=[1,2,3,4,5,6]
a_y=[1,2,3,4,5,6]

plt.plot(a_x, a_y)
plt.show()

Here is what the above code is Doing:
1. Importing the matplotlib library
2. Importing the pyplot module from the matplotlib library
3. Creating two lists, a_x and a_y, that will be used to plot the data
4. Plotting the data
5. Showing the plot

Similar Posts