Skip to content

Commit

Permalink
Update to matplotlib's current png interface
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewturk committed Apr 1, 2020
1 parent fa959a6 commit 49c3277
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yt/utilities/png_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
else:
from io import BytesIO as StringIO

def call_png_write_png(buffer, width, height, filename, dpi):
def call_png_write_png(buffer, width, height, fileobj, dpi):
_png.write_png(buffer, filename, dpi)

def write_png(buffer, filename, dpi=100):
width = buffer.shape[1]
height = buffer.shape[0]
call_png_write_png(buffer, width, height, filename, dpi)
with open(filename, "wb") as fileobj:
call_png_write_png(buffer, width, height, fileobj, dpi)

def write_png_to_string(buffer, dpi=100, gray=0):
width = buffer.shape[1]
Expand Down

0 comments on commit 49c3277

Please sign in to comment.