[Bug]: Hexbin gridsize interpreted differently for x and y · Issue #21349 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: Hexbin gridsize interpreted differently for x and y #21349

Description

@timhoffm

Bug summary

gridsize results in 2x the expected number of elements in y-direction

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

np.random.seed(19680801)
n = 100000
x = np.random.standard_normal(n)
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)

fig, ax = plt.subplots(figsize=(6, 6))
h = ax.hexbin(x, y, gridsize=(10, 10), marginals=True, reduce_C_function=np.sum)

Actual outcome

grafik

Expected outcome

grafik

This image was taken with gridsize=(10, 5) but should be the result of gridsize=(10, 10).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions