0

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:

enter image description here

How can I do it correctly?

1 Answer 1

1

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>

standard

In [6]: plt.spy(a, aspect='auto')
Out[6]: <matplotlib.image.AxesImage at 0x7f9ad1139d30>

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.