Saving figure in matplotlib I have created a figure using matplotlib. Im using the following lines of codes to save the figure in a pdf.