Backport PR #13412 and #13337 on branch v3.0.x by QuLogic · Pull Request #13418 · matplotlib/matplotlib · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
108 changes: 54 additions & 54 deletions .flake8
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ addons:
- lmodern
- otf-freefont
- pgf
- qtbase5-dev
- texlive-fonts-recommended
- texlive-latex-base
- texlive-latex-extra
- texlive-latex-recommended
- texlive-xetex
- texlive-luatex
- texlive-xetex

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/qt_editor/figureoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def apply_callback(data):
rgba = mcolors.to_rgba(color)
line.set_alpha(None)
line.set_color(rgba)
if marker is not 'none':
if not isinstance(marker, str) or marker != 'none':
line.set_marker(marker)
line.set_markersize(markersize)
line.set_markerfacecolor(markerfacecolor)
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3665,8 +3665,8 @@ def __init__(self, dataset, bw_method=None):
elif (isString and bw_method == 'silverman'):
self.covariance_factor = self.silverman_factor
elif (np.isscalar(bw_method) and not isString):
self._bw_method = 'use constant'
self.covariance_factor = lambda: bw_method
self._bw_method = 'use constant'
self.covariance_factor = lambda: bw_method
elif callable(bw_method):
self._bw_method = bw_method
self.covariance_factor = lambda: self._bw_method(self)
Expand Down
8 changes: 3 additions & 5 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,11 +2176,10 @@ def matshow(A, fignum=None, **kwargs):
fignum : None or int or False
If *None*, create a new figure window with automatic numbering.

If *fignum* is an integer, draw into the figure with the given number
If a nonzero integer, draw into the figure with the given number
(create it if it does not exist).

If 0 or *False*, use the current axes if it exists instead of creating
a new figure.
If 0, use the current axes (or create one if it does not exist).

.. note::

Expand All @@ -2198,7 +2197,7 @@ def matshow(A, fignum=None, **kwargs):

"""
A = np.asanyarray(A)
if fignum is False or fignum is 0:
if fignum == 0:
ax = gca()
else:
# Extract actual aspect ratio of array and make appropriately sized figure
Expand All @@ -2207,7 +2206,6 @@ def matshow(A, fignum=None, **kwargs):

im = ax.matshow(A, **kwargs)
sci(im)

return im


Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def transform_non_affine(self, a):
# pass. On the other hand, in practice, we want to clip beyond
# np.log10(np.nextafter(0, 1)) ~ -323
# so 1000 seems safe.
out[a <= 0] = -1000
out[a <= 0] = -1000
return out

def __str__(self):
Expand Down
3 changes: 0 additions & 3 deletions lib/matplotlib/tests/test_preprocess_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ def test_compiletime_checks():
"""test decorator invocations -> no replacements"""

def func(ax, x, y): pass

def func_args(ax, x, y, *args): pass

def func_kwargs(ax, x, y, **kwargs): pass

def func_no_ax_args(*args, **kwargs): pass

# this is ok
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def _rendercursor(self):

def _notify_submit_observers(self):
for cid, func in self.submit_observers.items():
func(self.text)
func(self.text)

def _release(self, event):
if self.ignore(event):
Expand Down
3 changes: 1 addition & 2 deletions requirements/testing/travis_flake8.txt