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

Skip to content

Errorbars with yerr fail when fillstyle is specified #19776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rtobar opened this issue Mar 26, 2021 · 1 comment · Fixed by #19784
Closed

Errorbars with yerr fail when fillstyle is specified #19776

rtobar opened this issue Mar 26, 2021 · 1 comment · Fixed by #19784
Milestone

Comments

@rtobar
Copy link

rtobar commented Mar 26, 2021

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.

rtobar added a commit to ICRAR/shark that referenced this issue Mar 26, 2021
Version 3.4 was release just a couple of hours ago, so I hit this
problem just by chance -- and reported it upstream of course, more
details in matplotlib/matplotlib#19776.

Signed-off-by: Rodrigo Tobar <[email protected]>
@anntzer anntzer added this to the v3.4.0 milestone Mar 26, 2021
@QuLogic QuLogic modified the milestones: v3.4.0, v3.4.1 Mar 26, 2021
@smartlixx
Copy link
Contributor

This is caused by errorbar used fillstyle to plot the error bars, which should only be used to plot markers. However, I don't know why this was introduced from v3.3.4 to v3.4.0.

I will add a PR to fix this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants