Skip to content

Commit 4d1c787

Browse files
committed
Review comments
1 parent 54897bb commit 4d1c787

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,27 @@ to install/update.
131131
\input{/path/to/mytikz.tex}
132132
```
133133
Also make sure that the packages for PGFPlots and proper Unicode support and are
134-
included in the header of your document. Get the code via:
134+
included in the header of your document:
135+
```latex
136+
\usepackage[utf8]{inputenc}
137+
\usepackage{pgfplots}
138+
\DeclareUnicodeCharacter{2212}{−}
139+
\usepgfplotslibrary{groupplots,dateplot}
140+
\usetikzlibrary{patterns,shapes.arrows}
141+
\pgfplotsset{compat=newest}
142+
```
143+
or:
144+
```latex
145+
\setupcolors[state=start]
146+
\usemodule[tikz]
147+
\usemodule[pgfplots]
148+
\usepgfplotslibrary[groupplots,dateplot]
149+
\usetikzlibrary[patterns,shapes.arrows]
150+
\pgfplotsset{compat=newest}
151+
\unexpanded\def\startgroupplot{\groupplot}
152+
\unexpanded\def\stopgroupplot{\endgroupplot}
153+
```
154+
You can also get the code via:
135155
```python
136156
import tikzplotlib
137157
tikzplotlib.Flavors.latex.preamble()

test/helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def assert_equality(
3838
include_disclaimer=False,
3939
float_format=".8g",
4040
flavor=flavor,
41-
**extra_get_tikz_code_args
41+
**extra_get_tikz_code_args,
4242
)
4343
plt.close()
4444

@@ -53,7 +53,7 @@ def assert_equality(
5353
include_disclaimer=False,
5454
standalone=True,
5555
flavor=flavor,
56-
**extra_get_tikz_code_args
56+
**extra_get_tikz_code_args,
5757
)
5858
plt.close()
5959
assert _compile(code, flavor) is not None, code
@@ -70,14 +70,14 @@ def _compile(code, flavor):
7070
os.chdir(os.path.dirname(tex_file))
7171

7272
# compile the output to pdf
73-
cmds = dict(
73+
cmdline = dict(
7474
latex=["pdflatex", "--interaction=nonstopmode"],
7575
context=["context", "--nonstopmode"],
76-
)
76+
)[flavor]
7777
try:
78-
subprocess.check_output(cmds[flavor] + [tex_file], stderr=subprocess.STDOUT)
78+
subprocess.check_output(cmdline + [tex_file], stderr=subprocess.STDOUT)
7979
except subprocess.CalledProcessError as e:
80-
print("pdflatex output:")
80+
print(f"{cmdline[0]} output:")
8181
print("=" * 70)
8282
print(e.output.decode("utf-8"))
8383
print("=" * 70)

0 commit comments

Comments
 (0)