You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
# Tikzplotly
17
17
18
-
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.
18
+
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.
19
19
20
20
This results in a ti*k*z code, that can be easily included into your LaTeX document.
21
21
This also allows to easily edit the content of the figure.
@@ -101,9 +101,9 @@ To correctly compile the document, you will need to add the following packages t
101
101
102
102
## Note
103
103
104
-
* 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.
104
+
* 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.
105
105
You can also submit a pull request with the desired feature !
106
-
* Some feature can result in different output between the plotly figure and the TikZ figure, for instance the size of markers, more details can be found in [the documentation](https://thomas-saigre.github.io/tikzplotly/).
106
+
* Some feature can result in different output between the Plotly figure and the TikZ figure, for instance the size of markers, more details can be found in [the documentation](https://thomas-saigre.github.io/tikzplotly/).
We gather here some points that are different between a plotly figure and the corresponding Ti*k*Z figure generated with `tikzplotly`.
3
+
We gather here some points that are different between a Plotly figure and the corresponding Ti*k*Z figure generated with `tikzplotly`.
4
4
5
-
* Size of the objects: in plotly, the size is given in `px` unit, while in Ti*k*Z it is given in `pt`. A conversion is performed (`1 px = 0.75 pt`), but this still results in objects of different sizes.
6
-
* By default, the colors or the markers are not the same in plotly and pgfplots. For instance, if nothing is specified, plotly will always use a dot marker, while pgfplot will change for each trace.
7
-
* The order of displaying the traces may be unconsistent between plotly and pgfplots. For instance, for [this example](https://plotly.com/python/histograms/#several-histograms-for-the-different-values-of-one-column), the two traces are inverted.
8
-
* The angle of rotation is different between Plotly and Ti*k*Z, but the function Plotly ↦ Ti*k*Z is not know at this current point.
9
-
* When tricky names are used in symbolic expression (such as names with a space within), the space is removed by tisk plotly (*e.g.* the text `United Kingdom` in Plotly will be exported as `UnitedKindgon` in Ti*k*Z), fill free to update the exported file to render the figure you wish!
5
+
* Size of the objects: in Plotly, the size is given in `px` unit, while in Ti*k*Z it is given in `pt`. A conversion is performed (`1 px = 0.75 pt`), but this still results in objects of different sizes.
6
+
* By default, the colors or the markers are not the same in Plotly and pgfplots. For instance, if nothing is specified, Plotly will always use a dot marker, while pgfplots will change for each trace.
7
+
* The order of displaying the traces may be inconsistent between Plotly and pgfplots. For instance, for [this example](https://Plotly.com/python/histograms/#several-histograms-for-the-different-values-of-one-column), the two traces are inverted.
8
+
* The angle of rotation is different between Plotly and Ti*k*Z, but the function Plotly ↦ Ti*k*Z is not known at this current point.
9
+
* When tricky names are used in symbolic expression (such as names with a space within), the space is removed by tikzplotly (*e.g.* the text `United Kingdom` in Plotly will be exported as `UnitedKindgon` in Ti*k*Z), fill free to update the exported file to render the figure you wish!
Copy file name to clipboardExpand all lines: docs/plot/features.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@
6
6
7
7
From [Styling Markers in Python](https://plotly.com/python/marker-style/).
8
8
9
-
??? example "Marker Style Example"
9
+
??? Example "Marker Style Example"
10
+
10
11
```python
11
12
import plotly.express as px
12
13
import tikzplotly
@@ -26,6 +27,6 @@ From [Styling Markers in Python](https://plotly.com/python/marker-style/).
26
27
27
28
28
29
!!! Note
29
-
- There are somes markers implemented in plotly that are not available in pgfplots (or at least not referenced in the [documentation](https://tikz.dev/pgfplots/reference-markers)). For more details, refer to the example [test_markers](https://github.com/thomas-saigre/tikzplotly/blob/main/tests/test_markers.py). By defualt, the marker style `*` will be used.
30
-
- By default, the colors or the markers are not the same in plotly and pgfplots. For instance, if nothing is specified, plotly will always use a dot marker, while pgfplot will change for each trace.
30
+
- There are some markers implemented in Plotly that are not available in pgfplots (or at least not referenced in the [documentation](https://tikz.dev/pgfplots/reference-markers)). For more details, refer to the example [test_markers](https://github.com/thomas-saigre/tikzplotly/blob/main/tests/test_markers.py). By default, the marker style `*` will be used.
31
+
- By default, the colors or the markers are not the same in Plotly and pgfplots. For instance, if nothing is specified, Plotly will always use a dot marker, while pgfplots will change for each trace.
31
32
- The angle of rotation is different between Plotly and Ti*k*Z.
Copy file name to clipboardExpand all lines: docs/plot/supported.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The plots type supported by tikzplotly are presented in this page.
13
13
14
14
The code has been constructed to export (almost all) the figures of the page [Line Charts in Python](https://plotly.com/python/line-charts/) of Plotly documentation.
15
15
16
-
??? example "Scatter plot Example"
16
+
??? Example "Scatter plot Example"
17
17
18
18
```python
19
19
import plotly.express as px
@@ -31,7 +31,8 @@ The code has been constructed to export (almost all) the figures of the page [Li
31
31
32
32
The code has been constructed to export (almost all) the figures of the page [Heatmaps in Python](https://plotly.com/python/heatmaps/) of Plotly documentation.
33
33
34
-
??? example "Heatmap Example"
34
+
??? Example "Heatmap Example"
35
+
35
36
```python
36
37
import plotly.express as px
37
38
import tikzplotly
@@ -44,14 +45,15 @@ The code has been constructed to export (almost all) the figures of the page [He
- If possible, TikzPlotly try to save the heatmap as a png of the smallest size possible, namely 1 pixel for each value of the heatmap. But in some case, such export does not work. In this case, the image is saved in the original size of the Plotly figure.
48
+
- If possible, TikzPlotly try to save the heatmap as a PNG of the smallest size possible, namely 1 pixel for each value of the heatmap. But in some case, such export does not work. In this case, the image is saved in the original size of the Plotly figure.
48
49
49
50
50
51
## Histograms
51
52
52
53
The examples of the page [Histograms in Python](https://plotly.com/python/histograms/) of Plotly documentation are supported.
53
54
54
-
??? example "Histogram Example"
55
+
??? Example "Histogram Example"
56
+
55
57
```python
56
58
df = px.data.tips()
57
59
fig = px.histogram(df, x="total_bill")
@@ -68,7 +70,8 @@ The examples of the page [Histograms in Python](https://plotly.com/python/histog
68
70
69
71
Some examples of the page [Bar Charts in Python](https://plotly.com/python/bar-charts/) of Plotly documentation are supported (not stacked and aggregated bars).
70
72
71
-
??? example "Bar plot"
73
+
??? Example "Bar plot"
74
+
72
75
```python
73
76
wide_df = px.data.medals_wide()
74
77
fig = px.bar(
@@ -88,7 +91,8 @@ Some examples of the page [Bar Charts in Python](https://plotly.com/python/bar-c
88
91
The examples from the pages [Polar Charts in Python](https://plotly.com/python/polar-chart/) and [Radar Charts in Python](https://plotly.com/python/radar-chart/) are supported.
The arguments of the function `tikzplotly.save` are:
13
13
14
-
*`filename` (str): The name of the file where the ti*k*z code will be saved.
15
-
*`fig` (plotly.graph_objs.Figure): The figure to be saved.
16
-
*`tikz_options` (str, optional): The options to be passed to the `tikzpicture` environment. Default is `None`.
14
+
*`filename` (`str`): The name of the file where the ti*k*z code will be saved.
15
+
*`fig` (`plotly.graph_objs.Figure`): The figure to be saved.
16
+
*`tikz_options` (`str`, optional): The options to be passed to the `tikzpicture` environment. Default is `None`.
17
17
For example `tikz_options="scale=0.5"` will scale the figure by a factor 0.5.
18
-
*`axis_options` (str, optional): Option that you would like to manually add the the `axis` environment.
19
-
*`include_disclamer` (bool, optional): If `True`, the line `% This file was created with tikzplotly version XXX.` is added at the head of the generated code. Default is `True`.
20
-
*`img_name` (str, optional): only for the export of [heatmaps](supported.md#heat-maps), the name of the image that will be saved. Default is `heatmap.png`.
18
+
*`axis_options` (`str`, optional): Option that you would like to manually add to the `axis` environment.
19
+
*`include_disclamer` (`bool`, optional): If `True`, the line `% This file was created with tikzplotly version XXX.` is added at the head of the generated code. Default is `True`.
20
+
*`img_name` (`str`, optional): only for the export of [heatmaps](supported.md#heat-maps), the name of the image that will be saved. Default is `heatmap.png`.
21
+
*`decimate` (`int|None`, optional): only for the exports of scatter plots (in [2D](supported.md#scatter-plots) and [3D](supported.md#3d-scatter-plots)), reduce the number of data exported to only get the `decimate`-th ones (and the last one). If `None`, then all the data are exported. This is the default behavior.
0 commit comments