Skip to content

Commit a3acfc4

Browse files
committed
Revert "prettier readme"
This reverts commit b4fe40e.
1 parent 0e8d5dd commit a3acfc4

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

README.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ The output of tikzplotlib is in
3131
top of [PGF/TikZ](https://en.wikipedia.org/wiki/PGF/TikZ) and describes graphs in terms
3232
of axes, data etc. Consequently, the output of tikzplotlib
3333

34-
- retains more information,
35-
- can be more easily understood, and
36-
- is more easily editable
34+
* retains more information,
35+
* can be more easily understood, and
36+
* is more easily editable
3737

3838
than [raw TikZ output](https://matplotlib.org/users/whats_new.html#pgf-tikz-backend).
3939
For example, the matplotlib figure
40-
4140
```python
4241
import matplotlib.pyplot as plt
4342
import numpy as np
@@ -58,20 +57,16 @@ import tikzplotlib
5857

5958
tikzplotlib.save("test.tex")
6059
```
61-
6260
<!--close the figure and reset defaults
6361
<!--pytest-codeblocks:cont-->
64-
6562
```python
6663
import matplotlib as mpl
6764

6865
plt.close()
6966
mpl.rcParams.update(mpl.rcParamsDefault)
7067
```
71-
7268
-->
7369
(see above) gives
74-
7570
```latex
7671
\begin{tikzpicture}
7772
@@ -113,7 +108,6 @@ table {%
113108
114109
\end{tikzpicture}
115110
```
116-
117111
(Use `get_tikz_code()` instead of `save()` if you want the code as a string.)
118112

119113
Tweaking the plot is straightforward and can be done as part of your TeX work flow.
@@ -127,39 +121,33 @@ Notably, [3D plots don't work](https://github.com/matplotlib/matplotlib/issues/7
127121

128122
tikzplotlib is [available from the Python Package
129123
Index](https://pypi.org/project/tikzplotlib/), so simply do
130-
131124
```
132125
pip install tikzplotlib
133126
```
134-
135127
to install.
136128

129+
137130
### Usage
138131

139132
1. Generate your matplotlib plot as usual.
140133

141134
2. Instead of `pyplot.show()`, invoke tikzplotlib by
142-
143135
```python
144136
import tikzplotlib
145137

146138
tikzplotlib.save("mytikz.tex")
147139
# or
148140
tikzplotlib.save("mytikz.tex", flavor="context")
149141
```
150-
151-
to store the TikZ file as `mytikz.tex`.
142+
to store the TikZ file as `mytikz.tex`.
152143

153144
3. Add the contents of `mytikz.tex` into your TeX source code. A convenient way of
154145
doing so is via
155-
156146
```latex
157147
\input{/path/to/mytikz.tex}
158148
```
159-
160-
Also make sure that the packages for PGFPlots and proper Unicode support and are
161-
included in the header of your document:
162-
149+
Also make sure that the packages for PGFPlots and proper Unicode support and are
150+
included in the header of your document:
163151
```latex
164152
\usepackage[utf8]{inputenc}
165153
\usepackage{pgfplots}
@@ -168,9 +156,7 @@ to install.
168156
\usetikzlibrary{patterns,shapes.arrows}
169157
\pgfplotsset{compat=newest}
170158
```
171-
172-
or:
173-
159+
or:
174160
```latex
175161
\setupcolors[state=start]
176162
\usemodule[tikz]
@@ -181,9 +167,7 @@ to install.
181167
\unexpanded\def\startgroupplot{\groupplot}
182168
\unexpanded\def\stopgroupplot{\endgroupplot}
183169
```
184-
185-
You can also get the code via:
186-
170+
You can also get the code via:
187171
```python
188172
import tikzplotlib
189173

@@ -193,7 +177,6 @@ to install.
193177
```
194178

195179
4. Optional: clean up the figure before exporting to tikz using the `clean_figure` command.
196-
197180
```python
198181
import matplotlib.pyplot as plt
199182
import numpy as np
@@ -205,10 +188,9 @@ to install.
205188
tikzplotlib.clean_figure()
206189
tikzplotlib.save("test.tex")
207190
```
208-
209191
The command will remove points that are outside the axes limits, simplify curves and
210192
reduce point density for the specified target resolution.
211-
193+
212194
The feature originated from the
213195
[matlab2tikz](https://github.com/matlab2tikz/matlab2tikz) project and is adapted to
214196
matplotlib.
@@ -219,6 +201,7 @@ If you experience bugs, would like to contribute, have nice examples of what
219201
tikzplotlib can do, or if you are just looking for more information, then please
220202
visit [tikzplotlib's GitHub page](https://github.com/nschloe/tikzplotlib).
221203

204+
222205
### Testing
223206

224207
tikzplotlib has automatic unit testing to make sure that the software doesn't
@@ -227,7 +210,6 @@ Those run through tikzplotlib and compare the output with a previously stored
227210
reference TeX file.
228211

229212
To run the tests, just check out this repository and type
230-
231213
```
232214
pytest
233215
```

0 commit comments

Comments
 (0)