[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Apr 10 18:50:46 PDT 2017
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/c75e10b8a4ce/
Changeset: c75e10b8a4ce
Branch: yt
User: ngoldbaum
Date: 2017-04-04 15:17:36+00:00
Summary: Only set font parameters for matplotlib style context
Affected #: 1 file
diff -r 3fee41c2ea35fbe17c97ba1dc286d6e71f088716 -r c75e10b8a4ce5e3fff2429f5a7d0d0f0b1dd5a47 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -1011,7 +1011,7 @@
def dummy_context_manager(*args, **kwargs):
yield
-def matplotlib_style_context(style_name=None, after_reset=True):
+def matplotlib_style_context(style_name=None, after_reset=False):
"""Returns a context manager for controlling matplotlib style.
Arguments are passed to matplotlib.style.context() if specified. Defaults
@@ -1021,11 +1021,13 @@
available, returns a dummy context manager.
"""
if style_name is None:
- style_name = 'classic'
+ style_name = {
+ 'mathtext.fontset': 'cm',
+ 'mathtext.fallback_to_cm': True,
+ }
try:
import matplotlib.style
- if style_name in matplotlib.style.available:
- return matplotlib.style.context(style_name, after_reset=after_reset)
+ return matplotlib.style.context(style_name, after_reset=after_reset)
except ImportError:
pass
return dummy_context_manager()
https://bitbucket.org/yt_analysis/yt/commits/bd29e64137ef/
Changeset: bd29e64137ef
Branch: yt
User: ngoldbaum
Date: 2017-04-11 01:50:43+00:00
Summary: Merged in ngoldbaum/yt (pull request #2573)
Only set font parameters for matplotlib style context
Approved-by: Alexander Lindsay <al007 at illinois.edu>
Approved-by: Britton Smith <brittonsmith at gmail.com>
Affected #: 1 file
diff -r 3fb22b911041efd493b458070abacbf2031e817f -r bd29e64137efc0b63a190d587ff1766bab19db37 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -1011,7 +1011,7 @@
def dummy_context_manager(*args, **kwargs):
yield
-def matplotlib_style_context(style_name=None, after_reset=True):
+def matplotlib_style_context(style_name=None, after_reset=False):
"""Returns a context manager for controlling matplotlib style.
Arguments are passed to matplotlib.style.context() if specified. Defaults
@@ -1021,11 +1021,13 @@
available, returns a dummy context manager.
"""
if style_name is None:
- style_name = 'classic'
+ style_name = {
+ 'mathtext.fontset': 'cm',
+ 'mathtext.fallback_to_cm': True,
+ }
try:
import matplotlib.style
- if style_name in matplotlib.style.available:
- return matplotlib.style.context(style_name, after_reset=after_reset)
+ return matplotlib.style.context(style_name, after_reset=after_reset)
except ImportError:
pass
return dummy_context_manager()
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list