Skip to content

[Bug]: Refactor of hexbin for 3.6.0 crashes with empty arrays and log scaling #23922

Closed
@erykoff

Description

@erykoff

Bug summary

With 3.5 and previously, doing hexbin with empty arrays and log scaling just produced an empty plot. With 3.6.0 it crashes.

Code for reproduction

import matplotlib.pyplot as plt

plt.hexbin([], [], bins='log')

Actual outcome

...

File ~/miniforge3/envs/mpl36/lib/python3.10/site-packages/numpy/core/_methods.py:44, in _amin(a, axis, out, keepdims, initial, where)
42 def _amin(a, axis=None, out=None, keepdims=False,
43 initial=_NoValue, where=True):
---> 44 return umr_minimum(a, axis, None, out, keepdims, initial, where)

ValueError: zero-size array to reduction operation minimum which has no identity

Expected outcome

It just runs and then a plt.show() gives an empty rectangle.

Additional information

No response

Operating system

macos arm64

Matplotlib Version

3.6.0

Matplotlib Backend

MacOSX

Python version

3.10

Jupyter version

No response

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions