-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4950 from ericmjl/mep12-image_origin.py
Mep12 image origin.py
- Loading branch information
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#!/usr/bin/env python | ||
""" | ||
You can specify whether images should be plotted with the array origin | ||
x[0,0] in the upper left or upper right by using the origin parameter. | ||
You can also control the default be setting image.origin in your | ||
matplotlibrc file; see http://matplotlib.org/matplotlibrc | ||
""" | ||
from pylab import * | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
x = arange(100.0) | ||
x = np.arange(100.0) | ||
x.shape = (10, 10) | ||
|
||
interp = 'bilinear' | ||
#interp = 'nearest' | ||
lim = -2, 11, -2, 6 | ||
subplot(211, axisbg='g') | ||
title('blue should be up') | ||
imshow(x, origin='upper', interpolation=interp) | ||
#axis(lim) | ||
plt.subplot(211, axisbg='g') | ||
plt.title('blue should be up') | ||
plt.imshow(x, origin='upper', interpolation=interp, cmap='jet') | ||
#plt.axis(lim) | ||
|
||
subplot(212, axisbg='y') | ||
title('blue should be down') | ||
imshow(x, origin='lower', interpolation=interp) | ||
#axis(lim) | ||
show() | ||
plt.subplot(212, axisbg='y') | ||
plt.title('blue should be down') | ||
plt.imshow(x, origin='lower', interpolation=interp, cmap='jet') | ||
#plt.axis(lim) | ||
plt.show() |