X Tutup
Skip to content

update errorbar in Matplotlib 2.0.0 #8586

@mromanie

Description

@mromanie

I want to update matplotlib errorbar plotting as some input data varies. The code at:

#4556

doesn't seem to work with matplotlib 2.0.0 (works fine with version 1.5.2rc2). Hints? Thanks!!

Code for reproduction

For example:

import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
x = np.linspace(0, 2*np.pi, 15)
y = np.sin(x)
y_err = np.cos(x) * 0.1
err = ax.errorbar(x, y, y_err)
ln, (err_top, err_bot), (bars, ) = err

Actual outcome

returns the following erro:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: need more than 0 values to unpack

It used to work on 1.5.2rc2 and python 2.7.12.

Matplotlib version

  • Operating System: Mac OS X 10.11.6
  • Matplotlib Version: 2.0.0
  • Python Version: 2.7.13
  • Jupyter Version (if applicable):
  • Other Libraries:

Both python and matplotlib installed from MacPorts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup