Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

boxplot broken for empty inputs #13392

Copy link
Copy link
Closed
@anntzer

Description

@anntzer
Issue body actions

Bug report

Bug summary

Code for reproduction

boxplot([])

Actual outcome

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "matplotlib/lib/matplotlib/pyplot.py", line 2452, in boxplot
    is not None else {}))
  File "matplotlib/lib/matplotlib/__init__.py", line 1517, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "matplotlib/lib/matplotlib/axes/_axes.py", line 3521, in boxplot
    labels=labels, autorange=autorange)
  File "matplotlib/lib/matplotlib/cbook/__init__.py", line 1243, in boxplot_stats
    X = _reshape_2D(X, "X")
  File "matplotlib/lib/matplotlib/cbook/__init__.py", line 1419, in _reshape_2D
    if X.ndim == 1 and not isinstance(X[0], collections.abc.Iterable):
IndexError: index 0 is out of bounds for axis 0 with size 0

Expected outcome

An empty plot.

Matplotlib version

This is a regression in master, which bisects to #11921. Attn @jklymak

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): irrelevant
  • Python version: 3.7
  • Jupyter version (if applicable): none
  • Other libraries:

Thanks to @hershen for noticing this in https://github.com/matplotlib/matplotlib/pull/13368/files#r254847320.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.