I have created a figure using matplotlib. Im using the following lines of codes to save the figure in a pdf.
fig.tight_layout()
plt.savefig(“my plot.pdf”, format=”pdf”, bbox_inches=”tight”)
plt.show()
The original plot has four subplots, arranged in a 2×2 way. The output pdf file is not having the axes labels for the column 1 plots, it is cutting these labels. Im able to get these labels in the jupyter notebook but in the output pdf files they are missing. please suggest how to fix this issue.
I have tried the following lines of codes:
fig.tight_layout()
plt.savefig(“my plot.pdf”, format=”pdf”, bbox_inches=”tight”)
plt.show()
but it is not generating the desired output. I want help in generating the plots in a pdf file without any extra whitespace (so, the “tight” option is important for me) and all axes labels intact.
top north 5088 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1