Closed
Description
When I do
from matplotlib import pyplot as plt
import numpy as np
plt.bar(np.array([0, 1, 2, 3], dtype=np.uint8), [2, 3, 4, 5])
I get an unexpected result -- the values for the bar centers are interpreted as [0, 257, 258, 259]
. Similar things do not happen with plt.plot
and plt.scatter
. The environment is matplotlib v. 1.4.3, numpy v. 1.9.2. in an IPython notebook, IPython v. 3.2.
This is a screenshot of the above example after doing plt.gca().set_xlim([250, 260])
.