Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: matplotlib.pyplot.spy: does not work correctly for sparse matrices with many entries (>= 2**32) #6368

Closed
jor- opened this issue May 5, 2016 · 2 comments

Comments

@jor-
Copy link
Contributor

jor- commented May 5, 2016

matplotlib.pyplot.spy does not work correctly for sparse matrices with a large number of entries (>= 2**32). I would guess it has something to do with the value range of int32.

An example that reproduces the bug is:

import numpy as np
import scipy.sparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
n = 16
s = 2**n
A = scipy.sparse.coo_matrix(np.ones((s,s), dtype=np.int8))
plt.spy(A)
file = '/tmp/spy_{}.png'.format(n)
plt.savefig(file)

For n = 16, spy shows only some entries.
spy_16
For n = 15 it works correctly.
spy_15

I have used Matplotlib 1.5.1 installed over pip with Python 3.5.1 on Linux.

@jor-
Copy link
Contributor Author

jor- commented May 12, 2016

I have traced back the bug a little. matplotlib.axes.Axes.add_line does not work correctly for a large number of data (>= 2**32). See #6413.

@efiring
Copy link
Member

efiring commented May 15, 2016

I'm going to close this as a duplicate since #6413 is pointing to the root of the problem.

@efiring efiring closed this as completed May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants