Save plot to image file using Python Matplotlib
Save plot to image file:
import matplotlib.pyplot as plt plt.grid(True, linewidth=0.5, color='#ff0000', linestyle='-') #Plot a line graph plt.plot([10, 20, 30, 40, 50]) # Add labels and title plt.title("Interactive Plot") plt.xlabel("X-axis") plt.ylabel("Y-axis") plt.savefig("foo.png", bbox_inches='tight')
The following is the output that will be obtained:
2018-10-30T07:04:00+05:30
2018-10-30T07:04:00+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution