Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Server maintenance on Tue 31.5. at 12:00.
Open sidebar
Timo Heikkilä
PET-rating
Commits
45404c92
Commit
45404c92
authored
May 22, 2020
by
Ossi Laine
Browse files
Error handling to test function
parent
06372299
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot_image.py
View file @
45404c92
...
...
@@ -46,7 +46,12 @@ def show_images(images, cols=1, titles=None):
"""
# default embody image for the background
default_img
=
plt
.
imread
(
"./dummy_600.png"
)
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,7 +72,8 @@ 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
plt
.
imshow
(
default_img
,
extent
=
[
0
,
200
,
600
,
0
],
alpha
=
0.33
)
if
background
:
plt
.
imshow
(
default_img
,
extent
=
[
0
,
200
,
600
,
0
],
alpha
=
0.33
)
a
.
set_title
(
title
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment