How to plot a Raster image without the white border?

I’m trying to save out some images with customized overlaps and colors. However, they all plot with a thick white border, which is a problem because it gets saved out that way as well.

here’s some example code,:

test_img = np.ones((50,50))

and here’s the output (notice the white border):

is there some border=False type command to turn it off?

If you use bokeh backend instead of matplotlib, there is an option border=0, you may also use toolbar=None, xaxis=None,yaxis=None.
By the way, in that case when you plot with bokeh the image is out of the frame, but if you use, your image will be saved correctly.

1 Like

thank you!