8000 FIX : cast linewidth to float in backends · matplotlib/matplotlib@e6b00a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e6b00a1

Browse files
committed
FIX : cast linewidth to float in backends
1 parent 984146e commit e6b00a1

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ def set_linewidth(self, w):
10411041
"""
10421042
Set the linewidth in points
10431043
"""
1044-
self._linewidth = w
1044+
self._linewidth = float(w)
10451045

10461046
def set_linestyle(self, style):
10471047
"""

lib/matplotlib/backends/backend_cairo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def set_joinstyle(self, js):
407407

408408

409409
def set_linewidth(self, w):
410-
self._linewidth = w
410+
self._linewidth = float(w)
411411
self.ctx.set_line_width (self.renderer.points_to_pixels(w))
412412

413413

lib/matplotlib/backends/backend_ps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def set_color(self, r, g, b, store=1):
259259
if store: self.color = (r,g,b)
260260

261261
def set_linewidth(self, linewidth, store=1):
262+
linewidth = float(linewidth)
262263
if linewidth != self.linewidth:
263264
self._pswriter.write("%1.3f setlinewidth\n"%linewidth)
264265
if store: self.linewidth = linewidth
@@ -451,10 +452,10 @@ def option_scale_image(self):
451452
ps backend support arbitrary scaling of image.
452453
"""
453454
return True
454-
455+
455456
def option_image_nocomposite(self):
456457
"""
457-
return whether to generate a composite image from multiple images on
458+
return whether to generate a composite image from multiple images on
458459
a set of axes
459460
"""
460461
return not rcParams['image.composite_image']

lib/matplotlib/backends/backend_wx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ def set_linewidth(self, w):
558558
"""
559559
Set the line width.
560560
"""
561+
w = float(w)
561562
DEBUG_MSG("set_linewidth()", 1, self)
562563
self.select()
563564
if w > 0 and w < 1:

0 commit comments

Comments
 (0)
0