8000 Add note on writing binary formats to stdout using savefig() · matplotlib/matplotlib@ef0d7cf · GitHub
[go: up one dir, main page]

Skip to content

Commit ef0d7cf

Browse files
committed
Add note on writing binary formats to stdout using savefig()
1 parent e2fbf41 commit ef0d7cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,10 @@ def savefig(self, fname, *, transparent=None, **kwargs):
21992199
:rc:`savefig.format` and the appropriate extension is appended to
22002200
*fname*.
22012201
2202+
To write a binary format like PNG to ``sys.stdout``, use the
2203+
underlying binary buffer
2204+
``savefig(sys.stdout.buffer, format='png', ...)``.
2205+
22022206
Other Parameters
22032207
----------------
22042208
dpi : float or 'figure', default: :rc:`savefig.dpi`

0 commit comments

Comments
 (0)
0