Errorbars with yerr fail when fillstyle is specified · Issue #19776 · matplotlib/matplotlib · GitHub
Skip to content

Errorbars with yerr fail when fillstyle is specified #19776

Description

@rtobar

Bug report

Bug summary

Errorbar plots don't accept the fillstyle keyword argument anymore when using yerr.

Code for reproduction

import matplotlib.pyplot as plt
plt.errorbar([1, 2, 3, 4, 5], [5, 6, 7, 8, 9], yerr=[[1, 1, 1, 1, 1], [1, 1, 1,1, 1]], ls='None', mfc='r', fillstyle='full', ecolor = 'r', mec='r',marker='s',markersize=7)

Actual outcome

>>> import matplotlib.pyplot as plt
>>> plt.errorbar([1, 2, 3, 4, 5], [5, 6, 7, 8, 9], yerr=[[1, 1, 1, 1, 1], [1, 1, 1,1, 1]], ls='None', mfc='r', fillstyle='full', ecolor = 'r', mec='r',marker='s',markersize=7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2741, in errorbar
    return gca().errorbar(
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/__init__.py", line 1352, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 3497, in errorbar
    barcols.append(self.vlines(
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/__init__.py", line 1352, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 1120, in vlines
    lines.update(kwargs)
  File "/opt/python_environments/shark/lib/python3.8/site-packages/matplotlib/artist.py", line 1062, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'LineCollection' object has no property 'fillstyle'

Expected outcome

The code to work as before.

Matplotlib version

Installed on a virtual environment via pip install -U matplotlib:

$ pip freeze | grep matplotlib
matplotlib==3.4.0

Downgrading to matplotlib!=3.4 (==3.3.4) works.

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions