October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block plots an image of a bird six times in two figures, with the default parameters as well as the optional arguments of origin and extent, with different options for each to demonstrate how these arguments influence the orientation of the image:
img = plt.imread('bird_small.png')
def plot(ax, origin, extent, title): ax.imshow(img, origin=origin, extent=extent) ax.xaxis.set_major_locator(MultipleLocator(25)) ax.yaxis.set_major_locator(MultipleLocator(25)) ax.set_title(title)
Read now
Unlock full access