@@ -485,6 +485,44 @@ def print_raw(self, filename_or_obj, *args, **kwargs):
485
485
print_rgba = print_raw
486
486
487
487
def print_png (self , filename_or_obj , * args , ** kwargs ):
488
+ """
489
+ Write the png data to the given file.
490
+
491
+ Parameters
492
+ ----------
493
+ filename_or_obj : str or PathLike or file-like object
494
+ The file to write to.
495
+
496
+ metadata : dict, optional
497
+ Metadata in the PNG file as key-value pairs of bytes or latin-1
498
+ encodable strings.
499
+ According to the PNG specification, keys must be shorter than 79
500
+ chars.
501
+
502
+ The PNG specification defines some common keywords that may be
503
+ used as appropriate:
504
+ - Title: Short (one line) title or caption for image.
505
+ - Author: Name of image's creator.
506
+ - Description: Description of image (possibly long).
507
+ - Copyright: Copyright notice.
508
+ - Creation Time: Time of original image creation
509
+ (usually RFC 1123 format).
510
+ - Software: Software used to create the image.
511
+ - Disclaimer: Legal disclaimer.
512
+ - Warning: Warning of nature of content.
513
+ - Source: Device used to create the image.
514
+ - Comment: Miscellaneous comment;
515
+ conversion from other image format.
516
+
517
+ Other keywords may be invented for other purposes.
518
+
519
+ If 'Software' is not given, an autogenerated value for matplotlib
520
+ will be used.
521
+
522
+ For more details see the PNG specification:
523
+ https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords
524
+
525
+ """
488
526
FigureCanvasAgg .draw (self )
489
527
renderer = self .get_renderer ()
490
528
0 commit comments