Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d6aee4d
add support for symbolic x and y coordinates
jsaussereau Mar 13, 2025
3d8b04e
Fix ValueError when color is not a string
jsaussereau Mar 15, 2025
21ae4ab
Add more special characters to sanitize_TeX_text
jsaussereau Mar 18, 2025
9f1e783
add 'treat_data' to sanitize string data
jsaussereau Mar 18, 2025
cefacc5
add support for bar plots
jsaussereau Mar 18, 2025
e23416e
add main tests from plotly documentation
jsaussereau Mar 18, 2025
fc3d5f2
add basic support for polar plots
jsaussereau Mar 19, 2025
b09cae7
fix bad tuple return value
jsaussereau Mar 19, 2025
feb0643
add support for polar plot fill
jsaussereau Mar 19, 2025
50a31a4
fix trace mode
jsaussereau Mar 19, 2025
4c40f35
add support for symbolic r
jsaussereau Mar 19, 2025
0d60171
add support for radians
jsaussereau Mar 19, 2025
e04a469
add support for clockwise direction
jsaussereau Mar 19, 2025
0dcf0cb
fix bad tick label anchor on rotate
jsaussereau Mar 20, 2025
1d5bff2
add support for polar period
jsaussereau Mar 20, 2025
4baf8b7
add support for polar category order
jsaussereau Mar 20, 2025
1282c4f
add support for scatterpolargl
jsaussereau Mar 20, 2025
2b938a0
add support for radial category order and array
jsaussereau Mar 20, 2025
2f91ca7
add support for sectors (partial polar axes)
jsaussereau Mar 20, 2025
38af53f
Add support for radial range
jsaussereau Mar 20, 2025
0c57421
Add a warning for log radial axis type
jsaussereau Mar 20, 2025
b97e599
add missing colors
jsaussereau Mar 20, 2025
65c7c3d
add all examples from plotly radar and polar charts documentation
jsaussereau Mar 20, 2025
acf9174
add limited support to horizontal bar charts
jsaussereau Apr 12, 2025
67701ef
rename figures in prevision of horizontal bar charts
jsaussereau Apr 12, 2025
59ffb87
add curly braces only if needed
jsaussereau Jul 2, 2025
b14cb05
remove month case
jsaussereau Jul 2, 2025
56fca2f
add basic support for scatter 3d plots
jsaussereau Jul 2, 2025
1f70b83
fix bad data name
jsaussereau Jul 2, 2025
ca7f8c7
add scatter3d tests from plotly documentation
jsaussereau Jul 2, 2025
e952cbf
add basic axis options for scatter3d
jsaussereau Jul 2, 2025
50b48c2
fix error when options is not defined
jsaussereau Jul 9, 2025
4c08d02
fix view not being handled properly
jsaussereau Jul 9, 2025
b687b9b
fix unsupported characters
jsaussereau Jul 9, 2025
74c8828
Fix indent
jsaussereau Jul 22, 2025
2170e76
Merge branch 'main' into main
thomas-saigre Jul 26, 2025
d32795c
tiny typos fixes
thomas-saigre Jul 26, 2025
5dfba8f
fix 'EnumeratedValidator' object is not callable error
jsaussereau Aug 1, 2025
98dc167
fix crash if output directory does not exist
jsaussereau Aug 1, 2025
df0887a
rename addData to add_data and addData3D to add_data3d
jsaussereau Aug 1, 2025
68ac156
fix type option being used instead of plot_type
jsaussereau Aug 1, 2025
12b4346
fix error if the input of treat_data is not a string
jsaussereau Aug 1, 2025
8cb1208
fix bad col name in generated tex
jsaussereau Aug 1, 2025
304fe86
fix tex error for data names or values including a space
jsaussereau Aug 1, 2025
7029466
removing call to replace_all_months, as it duplicates the functionali…
jsaussereau Aug 1, 2025
8c5f25d
fix tex error when using numbers in macro names
jsaussereau Aug 1, 2025
659f573
fix dataset headers #29
thomas-saigre Aug 5, 2025
d9b96ec
sanitize texts and TeX texts separately
thomas-saigre Aug 5, 2025
1765205
fix test with line charts
thomas-saigre Aug 5, 2025
f378bb3
add coverage tests for polar
thomas-saigre Aug 7, 2025
09cea5e
improve test_tikzplotly
thomas-saigre Aug 7, 2025
27e9b20
begin to work on scatter3d tests
thomas-saigre Aug 8, 2025
83ffaf8
continue to work on test for scatter 3d
thomas-saigre Aug 8, 2025
9e6c614
remove test of instance
thomas-saigre Aug 20, 2025
060066f
enhance Data3D initialization to generate a unique name using MD5 has…
thomas-saigre Aug 23, 2025
7147023
fix failing tests regarding empty plots
thomas-saigre Aug 25, 2025
8700a6a
fix raisong of unnecessary warnings
thomas-saigre Aug 25, 2025
bcd047d
improve code coverage for scatter3d
thomas-saigre Aug 25, 2025
3af6bfa
refactor: update sanitize_text function to use integer for keep_space…
thomas-saigre Oct 12, 2025
d436878
add remark in doc #33
thomas-saigre Oct 12, 2025
564ca87
fix tests #33
thomas-saigre Oct 12, 2025
ce08e43
add tests and coverage for bar
thomas-saigre Oct 12, 2025
754ea73
improve code #30
thomas-saigre Oct 12, 2025
ddc6380
other tiny improvments in code (doctrings etc) #30
thomas-saigre Oct 12, 2025
bf835f5
attemp to fix tests on MacOS due to different precision #19
thomas-saigre Oct 13, 2025
ef7a1f9
add documentation of new features in PR#30
thomas-saigre Oct 21, 2025
d485eb3
up [ci skip]
thomas-saigre Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ tikzplotly.save("example.tex", fig)
will result in the following ti*k*z code

```latex
\pgfplotstableread{data0 Australia New_Zealand
\pgfplotstableread{
x Australia NewZealand
1952 69.12 69.39
1957 70.33 70.26
1962 70.93 71.24
Expand All @@ -51,7 +52,7 @@ will result in the following ti*k*z code
1997 78.83 77.55
2002 80.37 79.11
2007 81.235 80.204
}\dataZ
}\dataA

\begin{tikzpicture}

Expand All @@ -60,11 +61,11 @@ will result in the following ti*k*z code

\begin{axis}[
xlabel=year,
ylabel=lifeExp,
ylabel=lifeExp
]
\addplot+ [mark=*, solid, color=636efa, mark options={solid, draw=636efa}] table[y=Australia] {\dataZ};
\addplot+ [mark=*, solid, color=636efa] table[y=Australia] {\dataA};
\addlegendentry{Australia}
\addplot+ [mark=*, solid, color=EF553B, mark options={solid, draw=EF553B}] table[y=New_Zealand] {\dataZ};
\addplot+ [mark=*, solid, color=EF553B] table[y=NewZealand] {\dataA};
\addlegendentry{New Zealand}
\end{axis}
\end{tikzpicture}
Expand Down
Binary file added docs/assets/examples/bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/examples/polar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/examples/radar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/examples/scatter3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/plot/NB.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ We gather here some points that are different between a plotly figure and the co
* 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.
* 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.
* 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.
* 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!
61 changes: 61 additions & 0 deletions docs/plot/supported.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,64 @@ The examples of the page [Histograms in Python](https://plotly.com/python/histog

!!! Note
- There may be issues when many histograms are plotted on the same figure...


## Bar plots

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).

??? example "Bar plot"
```python
wide_df = px.data.medals_wide()
fig = px.bar(
wide_df,
x="nation",
y=["gold", "silver", "bronze"],
color_discrete_map = {"gold": "gold", "silver": "silver", "bronze": "#cd7f32"}
)
fig.update_traces(marker_line_width=2, marker_line_color="black")
tikzplotly.save("bar.tex", fig)
```
![Bar plot Example](../assets/examples/bar.png)


## Polar and radar plots

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.


??? example "Polar plot"
```python
df = px.data.wind()
fig = px.line_polar(df, r="frequency", theta="direction", color="strength", line_close=True,
color_discrete_sequence=px.colors.sequential.Plasma_r,
template="plotly_dark",)
tikzploylt.save("polar.tex", fig)
```
![Polar plot Example](../assets/examples/polar.png)


??? example "Radar plot"
```python
df = pd.DataFrame(dict(
r=[1, 5, 2, 2, 3],
theta=['processing cost','mechanical properties','chemical stability',
'thermal stability', 'device integration']))
fig = px.line_polar(df, r='r', theta='theta', line_close=True)
tikzploylt.save("radar.tex", fig)
```
![Radar plot Example](../assets/examples/radar.png)


## 3D scatter plots

Examples from [3D Scatter Plots in Python ](https://plotly.com/python/3d-scatter-plots/) can be exported with tikzplotly.


??? example "3D scatter plot"
```python
df = px.data.iris()
fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width', color='species')
tikzploylt.save("scatter3d.tex", fig)
```
![3D scatter plot Example](../assets/examples/scatter3d.png)
Loading