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

Method print_pgf

lib/matplotlib/backends/backend_pgf.py:823–831  ·  view source on GitHub ↗

Output pgf macros for drawing the figure so it can be included and rendered in latex documents.

(self, fname_or_fh, **kwargs)

Source from the content-addressed store, hash-verified

821 _writeln(fh, r"\endgroup")
822
823 def print_pgf(self, fname_or_fh, **kwargs):
824 """
825 Output pgf macros for drawing the figure so it can be included and
826 rendered in latex documents.
827 """
828 with cbook.open_file_cm(fname_or_fh, "w", encoding="utf-8") as file:
829 if not cbook.file_requires_unicode(file):
830 file = codecs.getwriter("utf-8")(file)
831 self._print_pgf_to_fh(file, **kwargs)
832
833 def print_pdf(self, fname_or_fh, *, metadata=None, **kwargs):
834 """Use LaTeX to compile a pgf generated figure to pdf."""

Callers 1

print_pdfMethod · 0.95

Calls 1

_print_pgf_to_fhMethod · 0.95

Tested by

no test coverage detected