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

matrixprofile.analyze() raises AttributeError with matplotlib==3.5.0 #85

Open
sbetko opened this issue Dec 16, 2021 · 0 comments
Open

Comments

@sbetko
Copy link

sbetko commented Dec 16, 2021

Running matrixprofile.analyze() causes AttributeError: 'NoneType' object has no attribute 'get_subplotspec' when matplotlib version 3.5.0 is installed. All plots seem to be shown correctly, but due to the exception, the function never returns. Upgrading to matplotlib 3.5.1 resolves the issue.

The matrixprofile package lists matplotlib>=3.0.3 in requirements.txt. I haven't tested any other versions for this issue, but it might be worth adding matplotlib!=3.5.0 to the package requirements if this is a matplotlib bug and can't be fixed in matrixprofile itself.

To Reproduce
Environment setup:

python3.9 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install matrixprofile ipykernel matplotlib==3.5.0

Run the following in an IPython notebook:

import numpy as np
import matrixprofile as mp

np.random.seed(1)
vals = np.random.randn(500)
profile, figures = mp.analyze(vals)

It should throw an AttributeError. Then, restart the kernel, upgrade matplotlib with pip install matplotlib==3.5.1, and rerun the cell (it should run successfully).

Expected behavior
matrixprofile.analyze() returns without any errors on both matplotlib 3.5.0 and 3.5.1.

Desktop

  • OS: MacOS 12.0.1
  • Python: 3.9.6
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