Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7cad938

Browse files
authored
Merge pull request #6987 from tacaswell/doc_figurecanvasagg_methods
DOC: add doc strings to FigureCanvasAgg methods
2 parents 5e038b5 + 4e5b54c commit 7cad938

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,16 +479,44 @@ def get_renderer(self, cleared=False):
479479
return self.renderer
480480

481481
def tostring_rgb(self):
482+
'''Get the image as an RGB byte string
483+
484+
`draw` must be called at least once before this function will work and
485+
to update the renderer for any subsequent changes to the Figure.
486+
487+
Returns
488+
-------
489+
bytes
490+
'''
482491
if __debug__: verbose.report('FigureCanvasAgg.tostring_rgb',
483492
'debug-annoying')
484493
return self.renderer.tostring_rgb()
485494

486495
def tostring_argb(self):
496+
'''Get the image as an ARGB byte string
497+
498+
`draw` must be called at least once before this function will work and
499+
to update the renderer for any subsequent changes to the Figure.
500+
501+
Returns
502+
-------
503+
bytes
504+
505+
'''
487506
if __debug__: verbose.report('FigureCanvasAgg.tostring_argb',
488507
'debug-annoying')
489508
return self.renderer.tostring_argb()
490509

491510
def buffer_rgba(self):
511+
'''Get the image as an RGBA byte string
512+
513+
`draw` must be called at least once before this function will work and
514+
to update the renderer for any subsequent changes to the Figure.
515+
516+
Returns
517+
-------
518+
bytes
519+
'''
492520
if __debug__: verbose.report('FigureCanvasAgg.buffer_rgba',
493521
'debug-annoying')
494522
return self.renderer.buffer_rgba()

0 commit comments

Comments
 (0)