Skip to content

Commit

Permalink
Merge pull request #382 from theRealSuperMario/cleanfigure
Browse files Browse the repository at this point in the history
Cleanfigure
  • Loading branch information
nschloe committed Jan 27, 2020
2 parents b7cb3a0 + bcfbcd4 commit e534327
Show file tree
Hide file tree
Showing 4 changed files with 1,828 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@ to install/update.
\usepgfplotslibrary{dateplot}
```

4. Optional: clean up the figure before exporting to tikz using the `clean_figure` command.
```python
import matplotlib.pyplot as plt
import numpy as np

#... do your plotting

import tikzplotlib
tikzplotlib.clean_figure()
tikzplotlib.save("test.tex")
```
The command will remove points that are outside the axes limits, simplify curves and reduce point density for the specified target resolution.

The feature originated from the [matlab2tikz](https://github.com/matlab2tikz/matlab2tikz) project and is adapted to matplotlib.

### Contributing

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

0 comments on commit e534327

Please sign in to comment.