Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: AxesImage.set_data([[]]) causes FloatingPointException #7964

Closed
@astrofrog

Description

@astrofrog

The following code leads to a fatal Floating Point Exception 8 error with Matplotlib 2.0:

In [1]:  import numpy as np

In [2]: im = plt.imshow(np.random.random((128,128)))

In [3]: im.set_data([[]])

In [4]: /Users/tom/miniconda3/envs/dev/lib/python3.6/site-packages/matplotlib/image.py:327: RuntimeWarning: divide by zero encountered in double_scalars
  in_bbox.width / A.shape[1],
Floating point exception: 8

which then causes the Python session to end. This is a regression in 2.0, as it worked in 1.5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions