Skip to content
Snippets Groups Projects
Commit 45404c92 authored by Ossi Laine's avatar Ossi Laine
Browse files

Error handling to test function

parent 06372299
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,12 @@ def show_images(images, cols=1, titles=None):
"""
# default embody image for the background
try:
background = True
default_img = plt.imread("./dummy_600.png")
except FileNotFoundError:
background = False
# get a copy of the gray color map
my_cmap = copy.copy(plt.cm.get_cmap('gray'))
......@@ -67,6 +72,7 @@ def show_images(images, cols=1, titles=None):
plt.imshow(image, cmap=my_cmap)
# draw default background image with transparency on top of the points
if background:
plt.imshow(default_img, extent=[0, 200, 600, 0], alpha=0.33)
a.set_title(title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment