File: imshow.rws

package info (click to toggle)
reinteract 0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,884 kB
  • ctags: 1,244
  • sloc: python: 9,276; sh: 3,883; xml: 780; objc: 311; makefile: 253; ansic: 201
file content (23 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from replot import imshow
from numpy import *
import matplotlib

# meshgrid is a handy numpy command for creating x and y coordinate
# arrays for a 2-D grid
xx, yy = meshgrid(linspace(0, 2*pi, 100), linspace(0, 2*pi, 100))

# To get an idea of what these arrays look like, let's look at 
# their upper left corners
xx[0:3,0:3]
yy[0:3,0:3]

# Now use the coordinate arrays to display a function over the range
# [0,2pi] x [0,2pi]
imshow(sin(xx) * cos(2 * yy))

# You can use any of the keyword arguments from:
# http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes-imshow

imshow(sin(xx) * cos(2 * yy), 
       cmap=matplotlib.cm.copper, 
       extent=(0,2*pi,0,2*pi))