8000 Mrg animation merge by tacaswell · Pull Request #7622 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Mrg animation merge #7622

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
80d8dd8
DOC: partially numpydoc-ify animation module
tacaswell Dec 7, 2016
24c7aad
DOC: use auto summary in animation_api.rst
tacaswell Dec 8, 2016
e465fb7
DOC: start to add animation prose
tacaswell Dec 8, 2016
ff1e71e
DOC: address comments
tacaswell Dec 11, 2016
55017cd
DOC: re-work MovieWriter section a bit
tacaswell Dec 11, 2016
437386b
MNT: tweak MovieWriter.saving to be more cautious
tacaswell Dec 11, 2016
1a6c61c
DOC: address the rest of the comments
tacaswell Dec 11, 2016
8e8291c
DOC: Fix more typos and minor errors
tacaswell Dec 11, 2016
e3de3be
BUG: fix minpos handling and other log ticker problems
efiring Dec 9, 2016
8bdabcd
refactor LogFormatter classes for consistency, readability
efiring Dec 10, 2016
a8e7575
api_changes: add note about LogFormatter linthresh kwarg.
efiring Dec 10, 2016
aa36ec3
test for shared log axes
efiring Dec 10, 2016
93d09be
Merge pull request #7596 from anntzer/delay-fc-list-warning
QuLogic Dec 12, 2016
1a21bea
Merge pull request #7618 from samuelstjean/patch-1
tacaswell Dec 12, 2016
4c4779b
DOC: minor tweaks
tacaswell Dec 12, 2016
4177725
Merge pull request #7589 from tacaswell/doc_animation
dopplershift Dec 12, 2016
4d59447
Merge pull request #7598 from efiring/minpos_initial
tacaswell Dec 12, 2016
06dce26
API: convert string fontsize to points immediately
tacaswell Aug 30, 2016
2ddcc68
API: cache usetex value at text creation time
tacaswell Dec 3, 2016
23392f8
Merge pull request #7606 from tacaswell/mnt_more_paranoid_moviewriter…
efiring Dec 12, 2016
98e9fb2
STY: some whitespace cleanups
tacaswell Dec 3, 2016
bb37ab6
MNT: ensure that defaults are cached init
tacaswell Dec 3, 2016
a578628
STY: wrap long line
tacaswell Dec 4, 2016
b079583
MNT: remove None from value checks
tacaswell Dec 4, 2016
55c266c
MNT: set the family to rcParam value in init
tacaswell Dec 5, 2016
b6278e3
MNT: use else block to localize exceptions
tacaswell Dec 5, 2016
5f4eead
MNT: minor simplification
tacaswell Dec 12, 2016
f367003
Merge pull request #7007 from tacaswell/api_set_font_size_at_creation…
QuLogic Dec 12, 2016
bbe4fd8
Merge remote-tracking branch 'matplotlib/v2.x'
tacaswell Dec 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MNT: ensure that defaults are cached init
This appears to already be the case for all of these properties, but
remove the rcparams lookup from the get_* methods just to be sure.
  • Loading branch information
tacaswell committed Dec 12, 2016
commit bb37ab6fd1e2cbb9049feb2e66225701c36ba68e
33 changes: 6 additions & 27 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,11 @@ def __init__(self,
_init = None # used only by copy()
):
self._family = None
self._slant = None
self._variant = None
self._weight = None
self._stretch = None
self._size = None
self._slant = rcParams['font.style']
self._variant = rcParams['font.variant']
self._weight = rcParams['font.weight']
self._stretch = rcParams['font.stretch']
self._size = rcParams['font.size']
self._file = None

# This is used only by copy()
Expand Down Expand Up @@ -740,11 +740,6 @@ def get_family(self):
"""
Return a list of font names that comprise the font family.
"""
if self._family is None:
family = rcParams['font.family']
if is_string_like(family):
return [family]
return family
return self._family

def get_name(self):
Expand All @@ -759,8 +754,6 @@ def get_style(self):
Return the font style. Values are: 'normal', 'italic' or
'oblique'.
"""
if self._slant is None:
return rcParams['font.style']
return self._slant
get_slant = get_style

Expand All @@ -769,8 +762,6 @@ def get_variant(self):
Return the font variant. Values are: 'normal' or
'small-caps'.
"""
if self._variant is None:
return rcParams['font.variant']
return self._variant

def get_weight(self):
Expand All @@ -780,8 +771,6 @@ def get_weight(self):
'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold',
'heavy', 'extra bold', 'black'
"""
if self._weight is None:
return rcParams['font.weight']
return self._weight

def get_stretch(self):
Expand All @@ -790,26 +779,16 @@ def get_stretch(self):
'extra-condensed', 'condensed', 'semi-condensed', 'normal',
'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'.
"""
if self._stretch is None:
return rcParams['font.stretch']
return self._stretch

def get_size(self):
"""
Return the font size.
"""
if self._size is None:
return rcParams['font.size']
return self._size

def get_size_in_points(self):
if self._size is not None:
try:
return float(self._size)
except ValueError:
pass
default_size = FontManager.get_default_size()
return default_size * font_scalings.get(self._size)
return self._size

def get_file(self):
"""
Expand Down
10 changes: 6 additions & 4 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def _get_layout(self, renderer):

baseline = 0
for i, line in enumerate(lines):
clean_line, ismath = self.is_math_text(line)
clean_line, ismath = self.is_math_text(line, self.get_usetex())
if clean_line:
w, h, d = renderer.get_text_width_height_descent(clean_line,
self._fontproperties,
Expand Down Expand Up @@ -782,7 +782,7 @@ def draw(self, renderer):
y = y + posy
if renderer.flipy():
y = canvash - y
clean_line, ismath = textobj.is_math_text(line)
clean_line, ismath = textobj.is_math_text(line, self.get_usetex())

if textobj.get_path_effects():
from matplotlib.patheffects import PathEffectRenderer
Expand Down Expand Up @@ -1212,7 +1212,7 @@ def set_text(self, s):
self.stale = True

@staticmethod
def is_math_text(s):
def is_math_text(s, usetex=None):
"""
Returns a cleaned string and a boolean flag.
The flag indicates if the given string *s* contains any mathtext,
Expand All @@ -1222,7 +1222,9 @@ def is_math_text(s):
"""
# Did we find an even number of non-escaped dollar signs?
# If so, treat is as math text.
if self.get_usetex():
if usetex is None:
usetex = rcParams['text.usetex']
if usetex:
if s == ' ':
s = r'\ '
return s, 'TeX'
Expand Down
0