8000 Colors drawn outside axis for hist2d · Issue #7350 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Colors drawn outside axis for hist2d #7350
Closed
@dfreese

Description

@dfreese

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()

overfill_example.pdf

overfill_example_zoom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0