|
6 | 6 | from matplotlib.figure import Figure, figaspect |
7 | 7 | from matplotlib.backend_bases import FigureCanvasBase |
8 | 8 | from matplotlib.image import imread as _imread |
| 9 | +from matplotlib.image import imsave as _imsave |
9 | 10 | from matplotlib import rcParams, rcParamsDefault, get_backend |
10 | 11 | from matplotlib.rcsetup import interactive_bk as _interactive_bk |
11 | 12 | from matplotlib.artist import getp, get, Artist |
@@ -1181,6 +1182,7 @@ def plotting(): |
1181 | 1182 | legend add a legend to the axes |
1182 | 1183 | loglog a log log plot |
1183 | 1184 | imread load image file into array |
| 1185 | + imsave save array as an image file |
1184 | 1186 | imshow plot image data |
1185 | 1187 | matshow display a matrix in a new figure preserving aspect |
1186 | 1188 | pcolor make a pseudocolor plot |
@@ -1230,7 +1232,7 @@ def plotting(): |
1230 | 1232 | def get_plot_commands(): return ( 'axes', 'axis', 'bar', 'boxplot', 'cla', 'clf', |
1231 | 1233 | 'close', 'colorbar', 'cohere', 'csd', 'draw', 'errorbar', |
1232 | 1234 | 'figlegend', 'figtext', 'figimage', 'figure', 'fill', 'gca', |
1233 | | - 'gcf', 'gci', 'get', 'gray', 'barh', 'jet', 'hist', 'hold', 'imread', |
| 1235 | + 'gcf', 'gci', 'get', 'gray', 'barh', 'jet', 'hist', 'hold', 'imread', 'imsave', |
1234 | 1236 | 'imshow', 'legend', 'loglog', 'quiver', 'rc', 'pcolor', 'pcolormesh', 'plot', 'psd', |
1235 | 1237 | 'savefig', 'scatter', 'set', 'semilogx', 'semilogy', 'show', |
1236 | 1238 | 'specgram', 'stem', 'subplot', 'table', 'text', 'title', 'xlabel', |
@@ -1370,6 +1372,11 @@ def imread(*args, **kwargs): |
1370 | 1372 | if _imread.__doc__ is not None: |
1371 | 1373 | imread.__doc__ = dedent(_imread.__doc__) |
1372 | 1374 |
|
| 1375 | +def imsave(*args, **kwargs): |
| 1376 | + return _imsave(*args, **kwargs) |
| 1377 | +if _imsave.__doc__ is not None: |
| 1378 | + imsave.__doc__ = dedent(_imsave.__doc__) |
| 1379 | + |
1373 | 1380 | def matshow(A, fignum=None, **kw): |
1374 | 1381 | """ |
1375 | 1382 | Display an array as a matrix in a new figure window. |
|
0 commit comments