Donbeo
Donbeo

Reputation: 17617

matplotlib plot a matrix of unbalanced axis

I have a matrix of size >>> X.shape (2194, 100) >>> I would like to plot it on square. How can I do that?

This is what I have tried

plt.matshow(X)
plt.show()

but the figure respects the ratio of the axis. I would like instead a squared figure.

Upvotes: 0

Views: 273

Answers (1)

mgab
mgab

Reputation: 3994

plt.imshow(X, aspect='auto', interpolation='None')
plt.colorbar()
plt.show()

This should give you what you want

Upvotes: 1

Related Questions