DexterInd / Raspbian_For_Robots

Raspbian image changes to make it work well with Dexter Industries robots.
http://www.dexterindustries.com/raspbian-for-robots/
Other
32 stars 18 forks source link

[Solved] Matplotlib.pyplt.imshow(image) does not create window / show image #214

Closed slowrunner closed 3 years ago

slowrunner commented 3 years ago

On the October 2020 R4R beta, Matplotlib.pyplt.imshow(image) does not create a window and show an image:

#!/usr/bin/env python3

# file: mpl_test.py

import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from time import sleep

# plt.ion()

print("matplotlib.get_backend():", plt.get_backend())
img = mpimg.imread('capture0.jpg')
print("image.shape:", img.shape)

imgplot = plt.imshow(img)
sleep(5)

It doesn’t complain of errors.

It claims to be using TkAgg as the background.

Matplotlib.pyplot.imshow(image)

does not display a window.

Pyimagesearch claims this is because of missing dependancies.

slowrunner commented 3 years ago

Solved - missing plt.show() statement