0

I have a following problem. I plot an graph over a background image. Sometimes Spyder (my IDE) plots over the the image strange white horizontal and vertical lines. See graphs bellow.

This is what sometimes happens: enter image description here

Desired output: enter image description here

I use this code:

import matplotlib.pyplot as plt
from PIL import Image

img = Image.open("./myimg.png")
plt.imshow(img)

x = mydata[['Centroid1']]
y = mydata[['Centroid2']]

scatter = ax.scatter(x, y, s=20, alpha=0.3, color='red')
plt.show()

Do you know, how can I delete these white lines?

vojtam
  • 1,157
  • 9
  • 34

1 Answers1

3

These white lines are the gridlines of you plot. I do not know why they appear but you can remove them with ax.grid(False).

Also, possible duplicate of How to hide axes and gridlines in Matplotlib (python).

SpaceBurger
  • 537
  • 2
  • 12