Skip to content

Commit e534327

Browse files
authored
Merge pull request #382 from theRealSuperMario/cleanfigure
Cleanfigure
2 parents b7cb3a0 + bcfbcd4 commit e534327

File tree

4 files changed

+1828
-0
lines changed

4 files changed

+1828
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ to install/update.
139139
\usepgfplotslibrary{dateplot}
140140
```
141141

142+
4. Optional: clean up the figure before exporting to tikz using the `clean_figure` command.
143+
```python
144+
import matplotlib.pyplot as plt
145+
import numpy as np
146+
147+
#... do your plotting
148+
149+
import tikzplotlib
150+
tikzplotlib.clean_figure()
151+
tikzplotlib.save("test.tex")
152+
```
153+
The command will remove points that are outside the axes limits, simplify curves and reduce point density for the specified target resolution.
154+
155+
The feature originated from the [matlab2tikz](https://github.com/matlab2tikz/matlab2tikz) project and is adapted to matplotlib.
156+
142157
### Contributing
143158

144159
If you experience bugs, would like to contribute, have nice examples of what

0 commit comments

Comments
 (0)