matplotlib 'spy' function gives incorrect plot

Bug #90356 reported by John Pye
2
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://math.nist.gov/MatrixMarket/
% 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.054643143142798458745
33 34 1
34 25 0.054609424508940254683
45 26 1
48 22 0.053821937145403411784
58 20 1
62 40 0.051502800816908882175
66 10 1
76 14 0.050401036017384562293
85 33 1
90 8 0.04827636527459408522
103 39 1
104 1 0.047357593452698590331
108 4 1
118 6 0.046168808547273877674
128 24 1
132 28 -4.3982297150257112506
133 11 -17.074271484359051954
134 18 -17.825720042487571249
135 5 0.049361553542753421053
136 27 -17.458078322276591621
137 23 -4.3982297150257112506
138 23 -18.849555921538758696
139 12 0.052604256284871545035
149 31 1
161 29 1
166 37 -18.849555921538758696
167 9 -18.604949812022685052
168 32 -18.215389629085230183
169 17 -4.3982297150257112506
170 17 -18.849555921538758696
171 28 -18.849555921538758696
175 13 -18.849555921538758696
176 30 -19.035616318827216276
179 13 -4.3982297150257112506
183 16 -19.314133000003423035
187 21 -18.849555921538758696
188 21 -4.3982297150257112506
192 3 -18.849555921538758696
193 3 -4.3982297150257112506
194 7 -19.326058527231953832
195 35 -18.849555921538758696
196 38 -18.849555921538758696
197 38 -4.3982297150257112506
198 2 -16.749322424296355649
199 35 -4.3982297150257112506
202 36 -18.849555921538758696
203 36 -4.3982297150257112506
204 19 -16.328875771026634567
229 37 -4.3982297150257112506

Revision history for this message
Rolf Leggewie (r0lf) wrote :

sorry for the delay in response.

do you still see this problem with the latest version of matplotlib?

Changed in matplotlib:
assignee: nobody → r0lf
status: New → Incomplete
Revision history for this message
Rolf Leggewie (r0lf) wrote :

From the lack of response, I will assume that the issue is no longer present. Feel free to reopen this report with more information.

Changed in matplotlib:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.