I am using Matplotlib to generate a series of sub-plots within a figure. I would like the figure to re-size according to the number of sub-plots being added to the figure so that the printed image is not distorted, and am therefore using the fig.set_figheight() method to resize the figure as the last step in my code. However, the printed image in the excel workbook retains the size it had from the previous execution of the code. The correct dimensions can be obtained by right-clicking the image and selecting “Reset Picture & Size”. However, I’m curious if this can be done from the python code?
It can be done fairly easily from VBA, but I am unsure if it is possible to call a VBA macro in the same file as the python code?