Metadata-Version: 2.1
Name: tikzplotly
Version: 0.1.0
Summary: Convert plotly figures to LaTeX / tikz figures
Author-email: Thomas Saigre <tikzplotly@outlook.fr>
License: The MIT License (MIT)
        
        Copyright (c) 2023 @thomas-saigre
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Code, https://github.com/thomas-saigre/tikzplotly
Project-URL: Issues, https://github.com/thomas-saigre/tikzplotly/issues
Keywords: plotly,latex,tikz,figure,conversion,graphics
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Scientific/Engineering :: Visualization
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

![alt text](doc/img/logo.svg "Tikzplotly")

# Tikzplotly

Convert [plotly](https://plotly.com/python/) figures to tikz code for inclusion into [PGFPlots](https://www.ctan.org/pkg/pgfplots) ([PGF/TikZ](https://www.ctan.org/pkg/pgf)) figures.

This results in a ti*k*z code, that can be easily included into your LaTeX document.
This also allow to easily edit the content of the figure.

## Example

The following Python code

```python
import plotly.express as px
import tikzplotly

df = px.data.gapminder().query("country=='Canada'")
fig = px.line(df, x="year", y="lifeExp", title='Life expectancy in Canada')
tikzplotly.save("example.tex", fig)
```

will result in the following ti*k*z code

```latex
% This file was created with tikzplotly version 0.0.1.
\begin{tikzpicture}

\definecolor{636efa}{HTML}{636efa}

\begin{axis}[
title=Life expectancy in Canada,
xlabel=year,
ylabel=lifeExp,
]
\addplot+ [mark=none, solid, color=636efa, forget plot] table {%
1952 68.75
1957 69.96
1962 71.3
1967 72.13
1972 72.88
1977 74.21
1982 75.76
1987 76.86
1992 77.95
1997 78.61
2002 79.77
2007 80.653
};
\end{axis}
\end{tikzpicture}
```


## Note

* This module is in development and new features are added bit by bit, when needed. If you have a feature request, please open an issue with the plotly figure you want to convert and the desired output.
You can also submit a pull request with the desired feature !
* Some feature can result in different output between the plotly figure and the tikz figure, for instance the size of markers.


## References

* [plotly](https://plotly.com/python/)
* [PGFPlots](https://www.ctan.org/pkg/pgfplots)
* [PGF/TikZ](https://www.ctan.org/pkg/pgf)
* [tikzplotlib](https://github.com/nschloe/tikzplotlib) : a similar project for matplotlib figures from which this one is inspired.


## License

This project is licensed under the MIT [License](LICENSE).
