Closed
Description
A bit of a nitpick, but when working with hist2d in matplotlib 2.0.0b3 installed using pip on OS X 10.9.5, I see a problem with the colors being drawn outside the axis ever so slightly at the top and right of the figure. I generated the attached example using this code:
import matplotlib
print matplotlib.__version__
import matplotlib.pyplot as plt
measured = np.random.rand(4)
x_pos = np.array((0., 0, 1, 1))
y_pos = np.array((0., 1, 0, 1))
x_pos_unique = np.unique(x_pos)
y_pos_unique = np.unique(y_pos)
x_bins = np.unique(np.hstack((x_pos_unique - 0.5, x_pos_unique + 0.5)))
y_bins = np.unique(np.hstack((y_pos_unique - 0.5, y_pos_unique + 0.5)))
plt.figure()
plt.hist2d(x_pos, y_pos, weights=measured, bins=(x_bins, y_bins))
plt.colorbar()
plt.savefig('overfill_example.pdf')
plt.show()
Metadata
Metadata
Assignees
Labels
No labels