Imwrite needs to use 'RGB', however after the red box been added onto the image, RGB is no longer the original RGB. The axes is sized to fit in the current figure and there are basically 3 different position vectors associated with the created axes that determine the bounds of the axes. OPf course, Set Figure Size I'd like to create a figure and save it in the background without displaying it. Can I turn off the borders? You can use the transparent argument to specify whether or not you want a transparent background for your saved image. Learn more about saveas . Matplotlib savefig background always transparent - Stack … The matplotlib pyplot’s savefig () function is used to save a plot as a file. You can use the transparent argument to specify whether or not you want a transparent background for your saved image. The following is the syntax: plt.savefig("filename.png", transparent=True) plt.savefig ("filename.png", transparent=True) Then, replace that pixel with the corresponding pixel information from the background image. -color-mono. First, assemble your figure as you normally would. Matlab plot In the LaTeX document I got some problems with formatting using \textwidth and centering options when the EPS files has a border. While saving as JPG and Figuire it gives white space around the image. change the color background of a matplotlib figure figures While saving as JPG and Figuire it gives white space around the image. Read the background image which we are interested to add. OPf course, Set Figure Size I'd like to create a figure and save it in the background without displaying it. I am trying to remove the white background on my png picture I get from a code I created. less important, but also strange is that the figure is rotated 90º couterclockwise.