Skip to content

Commit

Permalink
Merge pull request #4950 from ericmjl/mep12-image_origin.py
Browse files Browse the repository at this point in the history
Mep12 image origin.py
  • Loading branch information
WeatherGod committed Aug 19, 2015
2 parents 3f3b92f + 4c20aa8 commit abfee3f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions examples/pylab_examples/image_origin.py
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()

0 comments on commit abfee3f

Please sign in to comment.