Skip to content

Commit

Permalink
Merge pull request #1456 from pwuertz/pgf-doc-fixes
Browse files Browse the repository at this point in the history
pgf: documentation fixes
  • Loading branch information
Peter Würtz committed Nov 7, 2012
2 parents ec13ae9 + 431f9cf commit 58f1f6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions doc/users/pgf.rst
Expand Up @@ -6,7 +6,7 @@ Typesetting With XeLaTeX/LuaLaTeX

Using the ``pgf`` backend, matplotlib can export figures as pgf drawing commands
that can be processed with pdflatex, xelatex or lualatex. XeLaTeX and LuaLaTeX
have full unicode support and can use any fonts installed in the operating
have full unicode support and can use any font that is installed in the operating
system, making use of advanced typographic features of OpenType, AAT and
Graphite. Pgf pictures created by ``plt.savefig('figure.pgf')`` can be
embedded as raw commands in LaTeX documents. Figures can also be directly
Expand All @@ -25,7 +25,7 @@ or registering it for handling pdf output
matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf)
The second method allows you to keep using regular interactive backends and to
save PDF files from the graphical user interface.
save xelatex, lualatex or pdflatex compiled PDF files from the graphical user interface.

Matplotlib's pgf support requires a recent LaTeX_ installation that includes
the TikZ/PGF packages (such as TeXLive_), preferably with XeLaTeX or LuaLaTeX
Expand Down Expand Up @@ -67,6 +67,9 @@ Computer Modern font face but require extended unicode support, consider
installing the `Computer Modern Unicode <http://sourceforge.net/projects/cm-unicode/>`_
fonts *CMU Serif*, *CMU Sans Serif*, etc.

When saving to ``.pgf``, the font configuration matplotlib used for the
layout of the figure is included in the header of the text file.

.. literalinclude:: plotting/examples/pgf_fonts.py
:end-before: plt.savefig

Expand Down Expand Up @@ -144,6 +147,11 @@ Troubleshooting
ways to cause problems. When experiencing problems, try to minimalize or
disable the custom preamble.

* If the font configuration used by matplotlib differs from the font setting
in yout LaTeX document, the alignment of text elements in imported figures
may be off. Check the header of your ``.pgf`` file if you are unsure about
the fonts matplotlib used for the layout.

* If you still need help, please see :ref:`reporting-problems`

.. _LaTeX: http://www.tug.org
Expand Down
2 changes: 1 addition & 1 deletion doc/users/whats_new.rst
Expand Up @@ -45,7 +45,7 @@ sufficiently mature.
PGF/TikZ backend
----------------
Peter Würtz wrote a backend that allows matplotlib to export figures as
drawing commands for LaTeX that can be processed by PdfLaTeX, XeLaTeX or
drawing commands for LaTeX. These can be processed by PdfLaTeX, XeLaTeX or
LuaLaTeX using the PGF/TikZ package. Usage examples and documentation are
found in :ref:`pgf-tutorial`.

Expand Down

0 comments on commit 58f1f6d

Please sign in to comment.