fork download
  1. import matplotlib.pyplot as plt
  2.  
  3. # Plot two lines with labels
  4. plt.plot([1, 2, 3], [4, 5, 6], label='Line 1')
  5. plt.plot([1, 2, 3], [6, 5, 4], label='Line 2')
  6.  
  7. # Add legend
  8. plt.legend()
  9.  
  10. # Add titles
  11. plt.title('Example Plot')
  12. plt.xlabel('X-axis')
  13. plt.ylabel('Y-axis')
  14.  
  15. plt.show()
Success #stdin #stdout 2.16s 56668KB
stdin
Standard input is empty
stdout
Standard output is empty