Why the following snippet (using pyplot inside jupyter notebook):
plt.rcParams['figure.figsize'] = [10, 10]
plt.hist2d(np.random.randint(1e10, size=100000),
np.random.randint(1e10, size=100000))
plt.xlim(-1, 1)
plt.ylim(-1, 1)
plt.show()
gives this error:
ValueError: Image size of -1757369422x-759354895 pixels is too large. It must be less than 2^16 in each direction.
Without setting xlim
and ylim
runs fine. How to effectively set bounds of what is shown on that kind of plots?