Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58f1f6d

Browse files
author
Peter Würtz
committed
Merge pull request #1456 from pwuertz/pgf-doc-fixes
pgf: documentation fixes
2 parents ec13ae9 + 431f9cf commit 58f1f6d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

doc/users/pgf.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Typesetting With XeLaTeX/LuaLaTeX
66

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

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

70+
When saving to ``.pgf``, the font configuration matplotlib used for the
71+
layout of the figure is included in the header of the text file.
72+
7073
.. literalinclude:: plotting/examples/pgf_fonts.py
7174
:end-before: plt.savefig
7275

@@ -144,6 +147,11 @@ Troubleshooting
144147
ways to cause problems. When experiencing problems, try to minimalize or
145148
disable the custom preamble.
146149

150+
* If the font configuration used by matplotlib differs from the font setting
151+
in yout LaTeX document, the alignment of text elements in imported figures
152+
may be off. Check the header of your ``.pgf`` file if you are unsure about
153+
the fonts matplotlib used for the layout.
154+
147155
* If you still need help, please see :ref:`reporting-problems`
148156

149157
.. _LaTeX: http://www.tug.org

doc/users/whats_new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sufficiently mature.
4545
PGF/TikZ backend
4646
----------------
4747
Peter Würtz wrote a backend that allows matplotlib to export figures as
48-
drawing commands for LaTeX that can be processed by PdfLaTeX, XeLaTeX or
48+
drawing commands for LaTeX. These can be processed by PdfLaTeX, XeLaTeX or
4949
LuaLaTeX using the PGF/TikZ package. Usage examples and documentation are
5050
found in :ref:`pgf-tutorial`.
5151

0 commit comments

Comments
 (0)