Skip to content

XKCD context manager not resetting anymore in 2.1 #9520

@maxnoe

Description

@maxnoe

Bug report

Bug summary

The xkcd context manager does not reset the config anymore

Code for reproduction

import matplotlib.pyplot as plt

with plt.xkcd():
    plt.figure()
    plt.plot([1, 2, 3])
    plt.savefig('xkcd.png', dpi=300)


plt.figure()
plt.plot([1, 2, 3])
plt.savefig('not_xkcd.png', dpi=300)

Actual outcome

Both figures are in xkcd style

Expected outcome
Second figure should be using default style

Matplotlib version

  • Operating system:
  • Matplotlib version: 2.1
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.6

using anaconda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions