Coder Social home page Coder Social logo

OSError on 'science' as not a valid package style, path of style file, URL of style file, or library style name in v 2.0.1 about scienceplots HOT 2 CLOSED

dhakalnirajan avatar dhakalnirajan commented on May 20, 2024
OSError on 'science' as not a valid package style, path of style file, URL of style file, or library style name in v 2.0.1

from scienceplots.

Comments (2)

dhakalnirajan avatar dhakalnirajan commented on May 20, 2024 2

Hi @echedey-ls !

I tried the latest commit way using the code

!pip install git+https://github.com/garrettj403/SciencePlots

import scienceplots
import matplotlib.pyplot as plt

plt.style.use(['science', 'notebook', 'ieee'])

It worked.

Thanks!

If anyone is facing the error, you need to remove:

plt.style.reload_library()

if you have this code snippet as mpl removes the style from scienceplots library.

from scienceplots.

echedey-ls avatar echedey-ls commented on May 20, 2024 1

You don't have to reload the styles library. Remove plt.style.reload_library().

In the older versions, that was needed as SciencePlots copied the styles into Matplotlib default styles folder. After copying them you had to tell Matplotlib to update its styles. With the new version, importing SciencePlots registers new styles from the package folder, so if the library is reloaded after the import matplotlib statement, Matplotlib 'forgets' the SciencePlots ones.

Anyways, is that code from an example you found in current docs? I may have missed to update something.

from scienceplots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.