How embarrassing! :O  Well, as they say, 'nother set of eyes...<br><br>Thanks!<br><br>DG<br><br><div class="gmail_quote">On Mon, Mar 8, 2010 at 11:25 AM, Friedrich Romstedt <span dir="ltr"><<a href="mailto:friedrichromstedt@gmail.com">friedrichromstedt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It's pretty simple, but I was stunned myself how simple.  Have a look<br>
at line 65 of your script you provided:<br>
<br>
W = W.T<br>
<br>
This means,  x <-> y.  But in the for loops, you still act as if W<br>
wasn't transposed.  I added some prints, the positions should be clear<br>
for you:<br>
<br>
argW.shape = (320, 200)<br>
i, j = (0, 0)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (0, 50, 0, 80)<br>
part2plot.shape = (50, 80)<br>
i, j = (0, 1)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (50, 100, 0, 80)<br>
part2plot.shape = (50, 80)<br>
i, j = (0, 2)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (100, 150, 0, 80)<br>
part2plot.shape = (50, 80)<br>
i, j = (0, 3)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (150, 200, 0, 80)<br>
part2plot.shape = (50, 80)<br>
i, j = (1, 0)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (0, 50, 80, 160)<br>
part2plot.shape = (50, 80)<br>
i, j = (1, 1)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (50, 100, 80, 160)<br>
part2plot.shape = (50, 80)<br>
i, j = (1, 2)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (100, 150, 80, 160)<br>
part2plot.shape = (50, 80)<br>
i, j = (1, 3)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (150, 200, 80, 160)<br>
part2plot.shape = (50, 80)<br>
i, j = (2, 0)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (0, 50, 160, 240)<br>
part2plot.shape = (50, 40)<br>
i, j = (2, 1)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (50, 100, 160, 240)<br>
part2plot.shape = (50, 40)<br>
i, j = (2, 2)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (100, 150, 160, 240)<br>
part2plot.shape = (50, 40)<br>
i, j = (2, 3)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (150, 200, 160, 240)<br>
part2plot.shape = (50, 40)<br>
i, j = (3, 0)<br>
j*ny/4, (j+1)*ny/4, i*nx/4, (i+1)*nx/4 = (0, 50, 240, 320)<br>
part2plot.shape = (50, 0)<br>
<div class="im">Traceback (most recent call last):<br>
</div>  File "D:\Home\Friedrich\Entwicklung\2010\David\aquarius.py", line 91, in ?<br>
    ax.imshow(part2plot, extent = extent)<br>
  File "D:\Programme\Programmierung\python-2.4.1\lib\site-packages\matplotlib\ax<br>
es.py", line 5471, in imshow<br>
    im.autoscale_None()<br>
  File "D:\Programme\Programmierung\python-2.4.1\lib\site-packages\matplotlib\cm<br>
.py", line 148, in autoscale_None<br>
<div class="im">    self.norm.autoscale_None(self._A)<br>
</div>  File "D:\Programme\Programmierung\python-2.4.1\lib\site-packages\matplotlib\co<br>
lors.py", line 682, in autoscale_None<br>
<div class="im">    if self.vmin is None: self.vmin = ma.minimum(A)<br>
</div>  File "D:\Programme\Programmierung\python-2.4.1\lib\site-packages\numpy\ma\core<br>
.py", line 3042, in __call__<br>
    return self.reduce(a)<br>
  File "D:\Programme\Programmierung\python-2.4.1\lib\site-packages\numpy\ma\core<br>
.py", line 3057, in reduce<br>
<div class="im">    t = self.ufunc.reduce(target, **kargs)<br>
</div>ValueError: zero-size array to ufunc.reduce without identity<br>
<br>
So you simply have to exchange the role of x and y in your slice<br>
indicing expression, and everything will work out fine, I suspect :-)<br>
<br>
Or simpy leave out the transposition?  Note that in the other case,<br>
you also may have to consider to change to extent's axes to get it<br>
properly reflected.<br>
<br>
NB: With my version of matplotlib, it didn't accept the colormap, but<br>
when yours does, it doesn't matter.<br>
<div><div></div><div class="h5"><br>
Friedrich<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br>