Hello,
I wish to plot 4 different raster images within a figure, and later
plot registered lines highlighting certain features of them.
Here is the code to read one image and plot it, works as expcted:
img = Image.open(sys.argv[1])
img1 = numpy.asarray(img)
pylab.figure()
pylab.imshow(img1)
pyl
I have a couple questions about anim.py:
http://matplotlib.sourceforge.net/examples/anim.py
I'm running Python 2.5.1 and Matplotlib 0.90.1 under Win 2000.
1. Running anim.py at DOS prompt: it runs correctly until
the end:
Fatal Python error: PyEval_RestoreThread: NULL tstate
This appli
I have an integer array.
The number of different integers is small,
so small that I would like to define an
integer to color mapping and use this
with matshow. E.g.,
0 -> black
1 -> red
2 -> blue
etc
Possible?
Thank you,
Alan Isaac
-
Alan,
It sounds like what you want is a listed colormap with direct indexing
using a NoNorm() instance as the norm:
aa = ones((2,3), dtype=int)
aa[0,0] = 0
aa[:,2] = 2
cmap = mpl.colors.ListedColormap(['k', 'r', 'b'])
norm = mpl.colors.NoNorm()
matshow(aa, cmap=cmap, norm=norm, interpolation='ne