Reputation: 295
I have a 1800*100000000 matrix, and I want to plot it in python using code below:
import matplotlib.pyplot as plt
plt.spy(m)
plt.show()
The result is disappointing, it looks like a line because of little row number compared to column number:
How can I do it correctly?
Upvotes: 0
Views: 106
Reputation: 25023
spy()
accepts a number of keyword arguments, aspect
in particular is interesting...
In [1]: import numpy as np
In [2]: import matplotlib.pyplot as plt
In [3]: a = np.random.random((25,250))>0.6
In [4]: %matplotlib
Using matplotlib backend: Qt4Agg
In [5]: plt.spy(a)
Out[5]: <matplotlib.image.AxesImage at 0x7f9ad1a790b8>
In [6]: plt.spy(a, aspect='auto')
Out[6]: <matplotlib.image.AxesImage at 0x7f9ad1139d30>
Upvotes: 1