garrettj403 / SciencePlots

Matplotlib styles for scientific plotting
MIT License
6.96k stars 700 forks source link

OSError starting with SciencePlots==2.0.0 #78

Closed Tobias-Fischer closed 1 year ago

Tobias-Fischer commented 1 year ago

Hiya,

I love using SciencePlots, many thanks for the project!

On a fresh install, however, I cannot use the science style:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fischert/mambaforge/envs/DECRA/lib/python3.10/site-packages/matplotlib/style/core.py", line 162, in use
    raise IOError(
OSError: 'science' not found in the style library and input is not a valid URL or path; see `style.available` for list of available styles

It works fine for version 1.0.9 though. Any clues?

Thanks!

garrettj403 commented 1 year ago

Hi @Tobias-Fischer

We recently changed how the package is installed. You now need to add import scienceplots to the top of your file (before plt.style.use....

Does that work for you?

Tobias-Fischer commented 1 year ago

Awesome, thanks!