Advertisement
DrAungWinHtut

matplot.py

Jun 23rd, 2023
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2.  
  3. # Data
  4. x = [1, 2, 3, 4, 5]  # X-axis values
  5. y1 = [2, 4, 6, 8, 10]  # Y-axis values for the first data series
  6. y2 = [1, 3, 5, 7, 9]  # Y-axis values for the second data series
  7.  
  8. # Plotting
  9. plt.plot(x, y1, label='Series 1')
  10. plt.plot(x, y2, label='Series 2')
  11.  
  12. # Axes labels and title
  13. plt.xlabel('X-axis')
  14. plt.ylabel('Y-axis')
  15. plt.title('Graph for Two Values')
  16.  
  17. # Legend
  18. plt.legend()
  19.  
  20. # Display the plot
  21. plt.show()
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement