Skip to content

Add support for new plot types: polar, radar, 3D scatter, bar, and symbolic axes#30

Merged
thomas-saigre merged 67 commits into
thomas-saigre:mainfrom
jsaussereau:main
Oct 21, 2025
Merged

Add support for new plot types: polar, radar, 3D scatter, bar, and symbolic axes#30
thomas-saigre merged 67 commits into
thomas-saigre:mainfrom
jsaussereau:main

Conversation

@jsaussereau
Copy link
Copy Markdown
Contributor

Summary

This pull request introduces support for more plot types

Main changes

  • Add support for polar and radar plots
  • Add support for scatter 3D plots
  • Add support for bar plots (different from histograms)
  • Add support for symbolic axes (this generalizes the previous month implementation)
  • Add a few colors

Testing

Test were added for each new plot type using examples from plotly documentation

@thomas-saigre thomas-saigre linked an issue Aug 8, 2025 that may be closed by this pull request
Comment thread src/tikzplotly/_save.py
axis.add_option("zmajorgrids", "false")

# Title
if hasattr(figure_layout.scene, "title") and getattr(figure_layout.scene.title, "text", None):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attribute fig.layout.scene.title does not seem to exist. Do you have an example of code where this is used?

Comment thread src/tikzplotly/_scatter3d.py Outdated
if options is not None:
code += f"[{options}]"
else:
code += "[only marks]"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a particular reason for this option only marks? for a figure with mode=markers+lines, it adds this option while it shouldn't

@thomas-saigre thomas-saigre self-assigned this Aug 25, 2025
Comment thread src/tikzplotly/_polar.py
symbolic_theta = list(dict.fromkeys(theta))

if angular_categoryorder is not None:
if angular_categoryorder == "category ascending":
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsaussereau do you have example of plotly figure where this attribute is used ? I did not manage to find such one

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 91.31356% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tikzplotly/_scatter3d.py 84.05% 11 Missing ⚠️
src/tikzplotly/_polar.py 91.15% 10 Missing ⚠️
src/tikzplotly/_save.py 92.53% 5 Missing ⚠️
src/tikzplotly/_data.py 62.50% 3 Missing ⚠️
src/tikzplotly/_dataContainer.py 95.71% 3 Missing ⚠️
src/tikzplotly/_utils.py 83.33% 3 Missing ⚠️
src/tikzplotly/_bar.py 96.00% 2 Missing ⚠️
src/tikzplotly/_color.py 96.87% 2 Missing ⚠️
src/tikzplotly/_axis.py 66.66% 1 Missing ⚠️
src/tikzplotly/_heatmap.py 66.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/tikzplotly/_scatter.py 89.53% <100.00%> (ø)
src/tikzplotly/_tex.py 98.21% <ø> (+1.78%) ⬆️
src/tikzplotly/_axis.py 98.07% <66.66%> (-1.93%) ⬇️
src/tikzplotly/_heatmap.py 94.93% <66.66%> (+0.13%) ⬆️
src/tikzplotly/_bar.py 96.00% <96.00%> (ø)
src/tikzplotly/_color.py 99.57% <96.87%> (-0.16%) ⬇️
src/tikzplotly/_data.py 85.00% <62.50%> (-2.50%) ⬇️
src/tikzplotly/_dataContainer.py 96.93% <95.71%> (-3.07%) ⬇️
src/tikzplotly/_utils.py 93.24% <83.33%> (-6.76%) ⬇️
src/tikzplotly/_save.py 94.07% <92.53%> (+1.05%) ⬆️
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thomas-saigre
Copy link
Copy Markdown
Owner

@jsaussereau As you can see in #33 there were issues with complex texts in symbolic expression. My fix is not perfect, but it works so far.
Moreover, some bar plots are still not working correctly (especially horizontal ones), I opened a new issue about it #34, but I'll work on that after this PR is merged, as it is quite huge already ;)

@thomas-saigre
Copy link
Copy Markdown
Owner

thomas-saigre commented Oct 12, 2025

TODO before merging

  • add doctrings
  • run pylint to spot code that could be improved
  • add new content to documentation

@jsaussereau Thanks again for your contribution :D

@thomas-saigre thomas-saigre linked an issue Oct 13, 2025 that may be closed by this pull request
@thomas-saigre thomas-saigre merged commit 0c5bfc0 into thomas-saigre:main Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

correctly handle texts and symbolic coordinates tests not passing on some runners, due to machine precision support type bar

2 participants