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
4 changes: 2 additions & 2 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ def writeGouraudTriangles(self):
streamarr['points'] = (flat_points - points_min) * factor
streamarr['colors'] = flat_colors[:, :colordim] * 255.0

self.write(streamarr.tostring())
self.write(streamarr.tobytes())
self.endStream()
self.writeObject(self.gouraudObject, gouraudDict)

Expand Down Expand Up @@ -1487,7 +1487,7 @@ def _writeImg(self, data, height, width, grayscale, id, smask=None):
if png:
self._writePng(data)
else:
self.currentstream.write(data.tostring())
self.currentstream.write(data.tobytes())
self.endStream()

def writeImages(self):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def draw_gouraud_triangles(self, gc, points, colors, trans):
streamarr['points'] = (flat_points - points_min) * factor
streamarr['colors'] = flat_colors[:, :3] * 255.0

stream = quote_ps_string(streamarr.tostring())
stream = quote_ps_string(streamarr.tobytes())

self._pswriter.write(f"""\
gsave
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def draw_image(self, gc, x, y, im):
w = self.width
h = self.height
rows, cols = im.shape[:2]
bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tostring())
bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tobytes())
gc = self.get_gc()
gc.select()
gc.gfx_ctx.DrawBitmap(bitmap, int(l), int(self.height - b),
Expand Down