Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Fix xkcd() not resetting context anymore.#9603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -11,7 +11,7 @@ | ||
import pytest | ||
import matplotlib as mpl | ||
from matplotlib importpyplot as plt,style | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Just out of curiosity, is this import style "ok"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah, doing In that case that you are importing mulitple top level things is obscured, in this case we are importing multiple things from the same namespace (and renaming one).https://www.python.org/dev/peps/pep-0008/#imports | ||
from matplotlib.style.core import USER_LIBRARY_PATHS, STYLE_EXTENSION | ||
import six | ||
@@ -158,3 +158,16 @@ def test_alias(equiv_styles): | ||
rc_base = rc_dicts[0] | ||
for nm, rc in zip(equiv_styles[1:], rc_dicts[1:]): | ||
assert rc_base == rc | ||
def test_xkcd_no_cm(): | ||
assert mpl.rcParams["path.sketch"] is None | ||
plt.xkcd() | ||
assert mpl.rcParams["path.sketch"] == (1, 100, 2) | ||
def test_xkcd_cm(): | ||
assert mpl.rcParams["path.sketch"] is None | ||
with plt.xkcd(): | ||
assert mpl.rcParams["path.sketch"] == (1, 100, 2) | ||
assert mpl.rcParams["path.sketch"] is None |