Skip to content

Commit a37cdc5

Browse files
committed
Rely on builtin round() instead of manual rounding.
1 parent 5c58816 commit a37cdc5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def get_wx_font(self, s, prop):
283283
# Font colour is determined by the active wx.Pen
284284
# TODO: It may be wise to cache font information
285285
self.fontd[key] = font = wx.Font( # Cache the font and gc.
286-
pointSize=int(size + 0.5),
286+
pointSize=round(size),
287287
family=self.fontnames.get(prop.get_name(), wx.ROMAN),
288288
style=self.fontangles[prop.get_style()],
289289
weight=self.fontweights[prop.get_weight()])

lib/matplotlib/streamplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ def __init__(self, grid, mask):
285285

286286
def grid2mask(self, xi, yi):
287287
"""Return nearest space in mask-coords from given grid-coords."""
288-
return (int(xi * self.x_grid2mask + 0.5),
289-
int(yi * self.y_grid2mask + 0.5))
288+
return round(xi * self.x_grid2mask), round(yi * self.y_grid2mask)
290289

291290
def mask2grid(self, xm, ym):
292291
return xm * self.x_mask2grid, ym * self.y_mask2grid

0 commit comments

Comments
 (0)