1import matplotlib.pyplot as plt
2plt.plot([1, 2, 3, 4])
3plt.ylabel('some numbers')
4plt.show()
5
1# importing matplotlib module
2from matplotlib import pyplot as plt
3
4# x-axis values
5x = [5, 2, 9, 4, 7]
6
7# Y-axis values
8y = [10, 5, 8, 4, 2]
9
10# Function to plot scatter
11plt.scatter(x, y)
12
13# function to show the plot
14plt.show()
1from matplotlib import pyplot as plt
2
3import matplotlib.pyplot as plt1
4
5print(dir(plt) == dir(plt1))
6True
1import matplotlib.pyplot as plt # Import the matplotlib module
2from matplotlib import style # Optionally you dont need to use style
3style.use('ggplot') # Just for style
4
5x = [10, 20, 30, 40, 50] # Get points to plot on graph
6
7plt.plot(x) # We want to plot x on our graph
8plt.show()
9