6

The default style of matplotlib 2.0 looks very different from all previous versions.

I know that I can switch to the classic style with mpl.style.use('classic'), but how do I switch back to the new v2.0 style? Is the name of new default style listed in matplotlib.style.available ?

2 Answers 2

11

Per the API documentation:

The style name of default is reserved for reverting back to the default style settings.

In my distribution, 'default' is not listed in matplotlib.style.available, nor is it a key in matplotlib.style.library.

1
  • 2
    Thanks! The fact that the default style is not in matplotlib.style.available was a bit confusing.
    – VinceP
    Apr 7, 2017 at 13:37
9

After having applied a style in matplotlib, you can switch back to the defaults by

plt.rcParams.update(plt.rcParamsDefault)

If this happens inside a jupyter notebook, you would then also need to recall the backend, e.g. %matplotlib inline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.