garrettj403 / SciencePlots

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

[Bug]: 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 #108

Closed Hongru0306 closed 8 months ago

Hongru0306 commented 8 months ago

Environment

System: Windows-10-10.0.19041-SP0
Python: 3.8.16 (default, Jan 17 2023, 22:25:28) [MSC v.1916 64 bit (AMD64)]
SciencePlots: 2.1.1
Matplotlib: 3.5.1
Latex distro: (populate manually)

Describe the issue here

I'm sorry to bother you.
This bug is really crushing me, I don't know why the official repo can't be made to work with a few lines of guidance from the readme, but instead requires a lot of debugging and trial and error.
Besides, why don't you just add science inside available, instead of letting the user go through constant trial and error?

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

How can we reproduce it? What have you tried?

I've tried so many, including various latex reporting errors. Now that I've got latex installed, I still can't draw with the science class inside the readme, the other classes inside available do.

Extra info

No response

Hongru0306 commented 8 months ago

I have worked it on Linux, sorry to bother you!

flyingtiger111 commented 4 months ago

I'm experiencing the same problem. May I ask how you solved it

echedey-ls commented 4 months ago

I'm experiencing the same problem. May I ask how you solved it

@flyingtiger111

You need to install the package, in the environment you are using (if using a virtualenv make sure to activate it)

Then import the package import scienceplots on top of the script