def show(self):
with_matplotlib = True<EOL>try:<EOL><INDENT>import matplotlib.pyplot as plt<EOL><DEDENT>except RuntimeError:<EOL><INDENT>import skimage.io as io<EOL>with_matplotlib = False<EOL><DEDENT>if with_matplotlib:<EOL><INDENT>equalised_img = self.equalise()<EOL>_, ax = plt.subplots()<EOL>ax.imshow(equalised_img, cmap='<STR_LIT>')<EOL>import random<EOL>for contour_set in self.as_contours.values():<EOL><INDENT>r, g, b = random.random(), random.random(), random.random()<EOL>[ax.plot(contour[:,<NUM_LIT:1>], contour[:,<NUM_LIT:0>], linewidth=<NUM_LIT:2>, color=(r,g,b,<NUM_LIT:1>)) for contour in contour_set]<EOL><DEDENT>ax.axis('<STR_LIT:image>')<EOL>ax.set_xticks([])<EOL>ax.set_yticks([])<EOL>plt.show()<EOL><DEDENT>else:<EOL><INDENT>io.imshow(self.equalise())<EOL>io.show()<EOL><DEDENT>
Display the image