X Tutup
Skip to content

style.use not working for some cases #8348

@prasants

Description

@prasants

Bug report

  • When attempting to use Matplotlib Style, the selected style is not rendered.
  • ggplot and seaborn styles are working, but variations of seaborn are not working.
  • Example, plt.style.use('seaborn-paper') renders the default seaborn style.

Edit: It turns out that the problem is that matplotlib styles are not being applied after another style has been applied, as can be seen in this screencast.
https://youtu.be/bJtpXt34weA
By the way, in this video, I have commented out import seaborn, but that was an experiment to see if importing or not importing seaborn had any effect.
Code for reproduction

from https://github.com/prasants/pyds/blob/master/12.Introduction_to_Pandas.ipynb

%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (15,7)
whacked.plot(kind = "bar", legend=None)
plt.title('How People Died on The Sopranos')
plt.style.use('seaborn-paper')

Actual outcome
Screenshot

Expected outcome
Screenshot
Incorrect - see https://youtu.be/bJtpXt34weA

Platform

  • Matplotlib - 2.0.0
  • Python - 3.6.0
  • Seaborn - 0.7.1
  • Jupyter - 4.4.1
  • OS Sierra
  • Python installed via Homebrew, matplotlib and other libraries via pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup