matplotlib 'spy' function gives incorrect plot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
matplotlib (Ubuntu) |
Invalid
|
Undecided
|
Rolf Leggewie |
Bug Description
I have got some funny behaviour here that looks like a bug with the spy() function. Using the latest python-matplotlib 0.87.5 package on Ubuntu 6.10, I try:
$ ipython -pylab
from scipy import io
M = io.mmread('gd.mm')
spy(M)
M.shape
M.nnz
It looks great and I get the necessary number of dots on my 'spy' plot. Then:
spy(M.todense())
This seems to plot only half of the points. At first I thought the 'todense' function must be to blame, however:
D = M.todense()
for i in range(0,231):
for j in range(0,231):
if D[i,j]:
print i,j,D[i,j]
gave me the right data, so it really looks like a bug with spy().
And FWIW spy2(M) fails with an error, whereas spy2(D) shows the same bug as spy(D).
I wonder if this would warrant a backport of the 0.97.7 or 0.90 package, perhaps?
Following is the matrix file (not very big):
------8<-----
%%MatrixMarket matrix coordinate real general
% Matrix Market file format
% see http://
% RANGE: rows = 231, cols = 231, num_of_non_zeros =50
% MATRIX: rows = 231, cols = 231
231 231 50
% sparse value data:
% row#, col#, value
% whole matrix:
20 15 0.0546431431427
33 34 1
34 25 0.0546094245089
45 26 1
48 22 0.0538219371454
58 20 1
62 40 0.0515028008169
66 10 1
76 14 0.0504010360173
85 33 1
90 8 0.0482763652745
103 39 1
104 1 0.0473575934526
108 4 1
118 6 0.0461688085472
128 24 1
132 28 -4.398229715025
133 11 -17.07427148435
134 18 -17.82572004248
135 5 0.0493615535427
136 27 -17.45807832227
137 23 -4.398229715025
138 23 -18.84955592153
139 12 0.0526042562848
149 31 1
161 29 1
166 37 -18.84955592153
167 9 -18.60494981202
168 32 -18.21538962908
169 17 -4.398229715025
170 17 -18.84955592153
171 28 -18.84955592153
175 13 -18.84955592153
176 30 -19.03561631882
179 13 -4.398229715025
183 16 -19.31413300000
187 21 -18.84955592153
188 21 -4.398229715025
192 3 -18.84955592153
193 3 -4.398229715025
194 7 -19.32605852723
195 35 -18.84955592153
196 38 -18.84955592153
197 38 -4.398229715025
198 2 -16.74932242429
199 35 -4.398229715025
202 36 -18.84955592153
203 36 -4.398229715025
204 19 -16.32887577102
229 37 -4.398229715025
sorry for the delay in response.
do you still see this problem with the latest version of matplotlib?