Skip to content

Commit c864b7b

Browse files
committed
MNT: fix warnings on py38
These were fixed the on the master branch as part of bigger PRs or in different ways that are not worth backporting
1 parent bf2c5f6 commit c864b7b

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def paintEvent(self, e):
6868
if hasattr(qimage, 'setDevicePixelRatio'):
6969
# Not available on Qt4 or some older Qt5.
7070
qimage.setDevicePixelRatio(self._dpi_ratio)
71-
origin = QtCore.QPoint(l, self.renderer.height - t)
71+
origin = QtCore.QPoint(int(l), int(self.renderer.height - t))
7272
painter.drawImage(origin / self._dpi_ratio, qimage)
7373

7474
self._draw_rect_callback(painter)

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def apply_callback(data):
222222
rgba = mcolors.to_rgba(color)
223223
line.set_alpha(None)
224224
line.set_color(rgba)
225-
if marker is not 'none':
225+
if marker != 'none':
226226
line.set_marker(marker)
227227
line.set_markersize(markersize)
228228
line.set_markerfacecolor(markerfacecolor)

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def __init__(self, ax, *args, **kwargs):
870870
self.logscale = True
871871
if norm is None:
872872
norm = colors.LogNorm()
873-
if self.extend is not 'neither':
873+
if self.extend != 'neither':
874874
raise ValueError('extend kwarg does not work yet with log '
875875
' scale')
876876
else:

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343
The font directory code is from ttfquery,
4444
see license/LICENSE_TTFQUERY.
4545
"""
46-
47-
from collections import Iterable
46+
try:
47+
from collections.abc import Iterable
48+
except ImportError:
49+
from collections import Iterable
4850
import json
4951
import os
5052
import sys

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ def matshow(A, fignum=None, **kwargs):
24192419
24202420
"""
24212421
A = np.asanyarray(A)
2422-
if fignum is False or fignum is 0:
2422+
if fignum is False or fignum == 0:
24232423
ax = gca()
24242424
else:
24252425
# Extract actual aspect ratio of array and make appropriately sized figure

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy