Skip to content
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

Pin matplotlib version in requirements.txt or drop usage of hold to avoid AttributeError #75

Open
jhadjar opened this issue Feb 22, 2020 · 0 comments

Comments

@jhadjar
Copy link

jhadjar commented Feb 22, 2020

Summary:


Running the notebook ipynb/Economics.ipynb raises an AttributeError exception with matplotlib-3.1.3 installed.

Reproduce:


  • Run the notebook with a matplotlib version that deprecated hold

Actual outcome:


An AttributeError exception is raised.

Expected outcome:


A sweet notebook running.

Logs &/or traceback:


Traceback

AttributeError Traceback (most recent call last)
in
----> 1 show(population)

in show(population, k, percentiles, **kwargs)
19 plt.title('/'.join(map(str, percentiles)) + ' Percentile Plots')
20 times = [t for (t, pop) in results]
-->21 plt.hold(True); plt.xlabel('wealth'); plt.ylabel('time'); plt.grid(True)
22 for pct in percentiles:
23 line = [percent(pct, pop) for (t, pop) in results]

AttributeError: module 'matplotlib.pyplot' has no attribute 'hold'

Likely parts and draft fix:


Change requirements.txt to pin the matplotlib version to something like 2.1.0:

numpy
matplotlib==2.1.0

Another option is to update the code in ipynb/Economics.ipynb to use the updated API.

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

No branches or pull requests

1 participant