Skip to content

Zero-width figure crashes libpng #13857

Closed

Description

@amueller

Bug report

Bug summary

Zero-width figure crashes libpng.
This happens when using %matplotlib inline or saving to png.

Code for reproduction

import matplotlib.pyplot as plt
plt.subplots(1, 1, figsize=(3, 0))
plt.savefig("test.png")

Actual outcome

RuntimeError: libpng signaled error

Matplotlib version

  • Operating system: ubuntu / conda
  • Matplotlib version: 3.0.2, conda 3.0.2-py37h5429711_0 same at 3.0.3-py37h5429711_0
  • libpng 1.6.35-hbc83047_0, same with 1.6.36-hbc83047_

Apparently I broke "conda list" on my machine so getting all the versions seems a bit tricky.

Activity

  1. WeatherGod commented on Apr 3, 2019

    @WeatherGod
    Member
  2. WeatherGod commented on Apr 3, 2019

    @WeatherGod
    Member
  3. amueller commented on Apr 3, 2019

    @amueller
    ContributorAuthor

    yeah totally fine with an error. doing zero height works btw ?!
    I guess the expected behavior that I didn't specify is "either create an empty figure or raise an informative error".

  4. added this to the v3.2.0 milestone on Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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