MCPcopy Index your code
hub / github.com/plotly/plotly.py / save

Method save

_plotly_utils/png.py:1272–1286  ·  view source on GitHub ↗

Save the image to the named *file*. See `.write()` if you already have an open file object. In general, you can only call this method once; after it has been called the first time the PNG image is written, the source data will have been streamed, and cannot

(self, file)

Source from the content-addressed store, hash-verified

1270 self.info = info
1271
1272 def save(self, file):
1273 """Save the image to the named *file*.
1274
1275 See `.write()` if you already have an open file object.
1276
1277 In general, you can only call this method once;
1278 after it has been called the first time the PNG image is written,
1279 the source data will have been streamed, and
1280 cannot be streamed again.
1281 """
1282
1283 w = Writer(**self.info)
1284
1285 with open(file, "wb") as fd:
1286 w.write(fd, self.rows)
1287
1288 def write(self, file):
1289 """Write the image to the open file object.

Callers 4

pil_image_to_uriMethod · 0.45
image_array_to_data_uriFunction · 0.45
EFunction · 0.45
ilFunction · 0.45

Calls 2

writeMethod · 0.95
WriterClass · 0.85

Tested by

no test coverage detected