how to remove grid lines on image in python?

Karan Purohit picture Karan Purohit · May 26, 2018 · Viewed 11.2k times · Source

I am using google colab for my project. I am getting grid lines on images even I am not writing them.

from matplotlib import pyplot as plt
%matplotlib inline
import cv2

img = cv2.imread('k15.jpg')

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

plt.imshow(img)

enter image description here

for code like above, I am getting grid lines which is not the case when I run the same code in my python shell.

Answer

kawingkelvin picture kawingkelvin · Jun 2, 2018
plt.imshow(myImage)
plt.grid(None)   <---- this should remove that white grid