How can I use xlim / ylim with a hist2d plot ?
With the following code, the limits are applied but inline, the properly sized plot is displayed in a larger figure.
Without xlim / ylim, the plot is properly displayed.
%matplotlib inline
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.colors import LogNorm
data = pd.DataFrame(np.random.randint(0,101,(10000,2)), columns=['A','B'])
fig = plt.figure()
ax = fig.add_subplot(111)
(counts, ex, ey, img) = ax.hist2d(data['A'], data['B'], bins=(100,100), cmap="jet", norm=LogNorm(), alpha=.8)
ax.set_xlim(0,20)
ax.set_ylim(0,20)