MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / close

Method close

lib/matplotlib/backends/backend_pdf.py:851–860  ·  view source on GitHub ↗

Flush all buffers and free all resources.

(self)

Source from the content-addressed store, hash-verified

849 self.writeTrailer()
850
851 def close(self):
852 """Flush all buffers and free all resources."""
853
854 self.endStream()
855 if self.passed_in_file_object:
856 self.fh.flush()
857 else:
858 if self.original_file_like is not None:
859 self.original_file_like.write(self.fh.getvalue())
860 self.fh.close()
861
862 def write(self, data):
863 if self.currentstream is None:

Callers 15

print_pdfMethod · 0.95
clear_stateFunction · 0.45
render_figuresFunction · 0.45
_saveMethod · 0.45
closeMethod · 0.45
_shutdown_applicationFunction · 0.45
on_closeMethod · 0.45
destroyMethod · 0.45
feditFunction · 0.45
mpl.jsFile · 0.45
comm_websocket_adapterFunction · 0.45
test_completeFunction · 0.45

Calls 3

endStreamMethod · 0.95
flushMethod · 0.80
writeMethod · 0.45

Tested by 15

test_completeFunction · 0.36
test_gcfFunction · 0.36
test_canvas_changeFunction · 0.36
test_sharedFunction · 0.36
test_fig_closeFunction · 0.36
test_inverted_claFunction · 0.36
test_inverted_limitsFunction · 0.36
test_as_mpl_axes_apiFunction · 0.36