Skip to content

XKCD context manager not resetting anymore in 2.1 #9520

Closed

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

Activity

  1. jklymak commented on Oct 22, 2017

    @jklymak
    Member

    Is that example still documented that way? I think the way you do it now is at http://matplotlib.org/tutorials/introductory/customizing.html#temporary-styling

  2. jklymak commented on Oct 22, 2017

    @jklymak
    Member

    Yes fair enough. And it’s not implemented as a style.

  3. Kojoley commented on Oct 22, 2017

    @Kojoley
    Member

    2.0.2 is not affected, 2.1.0rc1 contains the bug.

  4. jklymak commented on Oct 22, 2017

    @jklymak
    Member

    Did this do it?

    74680f6

    @anntzer

  5. jklymak commented on Oct 22, 2017

    @jklymak
    Member

    I think I have a fix... See #9521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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