1
# Standard library imports
5
# Enthought library imports
6
from traits.util.resource import find_resource
7
from chaco.shell import imread, imshow, title, show
9
# Get the image file using the find_resource module
10
image_path = os.path.join('examples','basic','capitol.jpg')
11
alt_path = os.path.join('..','basic','capitol.jpg')
12
image_file = find_resource('Chaco', image_path, alt_path=alt_path)
14
# Check to see if the image was found
15
if image_file is None:
16
print 'The image "capitol.jpg" could not be found.'
20
image = imread(image_file)
23
imshow(image, origin="top left")
25
# Alternatively, you can call imshow using the path to the image file
29
title("Simple Image Plot")
31
# This command is only necessary if running from command line