Matplotlib

Reference
Author

Agastya Patel

Published

January 20, 2024

Modified

January 27, 2024

import matplotlib.pyplot as plt

plt.figure(figsize = (10,6)) //Aspect ratio of the plot
plt.suptitle('Super Title)
plt.set_tile('Title', loc='left)
plt.xlabel('X Label')
plt.ylabel('Y Label')

# Create scatter points
plt.scatter(y_test, predictions, label='Predictions', alpha=0.5, color='blue')
# Plot a line
plt.plot([min(y_test), max(y_test)], [min(y_test), max(y_test)], linestyle='--', color='gray', linewidth=2, label="Actual Observations")

plt.legend()  # Places legend on the plot
plt.show()