Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- # Data
- x = [1, 2, 3, 4, 5] # X-axis values
- y1 = [2, 4, 6, 8, 10] # Y-axis values for the first data series
- y2 = [1, 3, 5, 7, 9] # Y-axis values for the second data series
- # Plotting
- plt.plot(x, y1, label='Series 1')
- plt.plot(x, y2, label='Series 2')
- # Axes labels and title
- plt.xlabel('X-axis')
- plt.ylabel('Y-axis')
- plt.title('Graph for Two Values')
- # Legend
- plt.legend()
- # Display the plot
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement