wilsonrljr / sysidentpy

A Python Package For System Identification Using NARMAX Models
https://sysidentpy.org
BSD 3-Clause "New" or "Revised" License
380 stars 77 forks source link

Issue with matplotlib-3.8.0 package style 'seaborn-white' #122

Closed uqdlt closed 10 months ago

uqdlt commented 10 months ago

FileNotFoundError: [Errno 2] No such file or directory: 'seaborn-white'

OSError: 'seaborn-white' is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in style.available)

-> Solution: downgrade to lower matplotlib 3.3.3 works.

Attachment

pip list:

asttokens 2.4.1 certifi 2023.7.22 charset-normalizer 3.3.1 cloudpickle 3.0.0 colorama 0.4.6 comm 0.1.4 contourpy 1.1.1 cycler 0.12.1 debugpy 1.8.0 decorator 5.1.1 exceptiongroup 1.1.3 executing 2.0.1 filelock 3.13.0 fonttools 4.43.1 fsspec 2023.10.0 idna 3.4 importlib-metadata 6.8.0 importlib-resources 6.1.0 ipykernel 6.26.0 ipython 8.17.1 jedi 0.19.1 Jinja2 3.1.2 jupyter_client 8.5.0 jupyter_core 5.5.0 kiwisolver 1.4.5 MarkupSafe 2.1.3 matplotlib 3.8.0 matplotlib-inline 0.1.6 mpmath 1.3.0 nest-asyncio 1.5.8 networkx 3.2.1 numpy 1.26.0 packaging 23.2 pandas 2.1.2 parso 0.8.3 Pillow 10.1.0 pip 23.3.1 platformdirs 3.11.0 prompt-toolkit 3.0.39 psutil 5.9.6 pure-eval 0.2.2 Pygments 2.16.1 pyparsing 3.1.1 PyQt5 5.15.10 PyQt5-Qt5 5.15.2 PyQt5-sip 12.13.0 PySide2 5.15.2.1 python-dateutil 2.8.2 pytz 2023.3.post1 pywin32 306 pyzmq 25.1.1 requests 2.31.0 scipy 1.11.3 setuptools 68.2.2 shiboken2 5.15.2.1 six 1.16.0 spyder-kernels 2.4.4 stack-data 0.6.3 sympy 1.12 sysidentpy 0.3.3 torch 2.1.0 torchaudio 2.1.0 torchvision 0.16.0 tornado 6.3.3 traitlets 5.13.0 typing_extensions 4.8.0 tzdata 2023.3 urllib3 2.0.7 wcwidth 0.2.8 wheel 0.41.3 zipp 3.17.0

wilsonrljr commented 10 months ago

Hey @uqdlt, thanks for mentioning the issue. I'm updating the docs, but the solution is easy: just select another style from matplotlib. The following docs show how to do it: http://sysidentpy.org/examples/basic_steps/

plt.style.available will show all available styles and you can set the style in the plot_results method like this:

plot_results(y=y_valid, yhat=yhat, n=1000, title="test",
    xlabel="Samples",
    ylabel="y, $\hat{y}$",
    data_color="#1f77b4",
    model_color="#ff7f0e",
    marker="o",
    model_marker="*",
    linewidth=1.5,
    figsize=(10, 6),
    style='seaborn-v0_8-notebook',
    facecolor="white")

Let me know if that works for you.

uqdlt commented 10 months ago

Thank you, i selected another style.

word911 commented 8 months ago

use plt.style.use('seaborn-v0_8-white')


$python

>>>import matplotlib.pyplot as plt
>>>plt.style.available

['Solarize_Light2', '_classic_test_patch', '_mpl-gallery', '_mpl-gallery-nogrid', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-v0_8', 'seaborn-v0_8-bright', 'seaborn-v0_8-colorblind', 'seaborn-v0_8-dark', 'seaborn-v0_8-dark-palette', 'seaborn-v0_8-darkgrid', 'seaborn-v0_8-deep', 'seaborn-v0_8-muted', 'seaborn-v0_8-notebook', 'seaborn-v0_8-paper', 'seaborn-v0_8-pastel', 'seaborn-v0_8-poster', 'seaborn-v0_8-talk', 'seaborn-v0_8-ticks', 'seaborn-v0_8-white', 'seaborn-v0_8-whitegrid', 'tableau-colorblind10']