Skip to content

Add experimental support for exporting mplot3d plots - #64

Draft
DanielBetschinske wants to merge 3 commits into
ErwindeGelder:mainfrom
DanielBetschinske:feature/3dplots
Draft

Add experimental support for exporting mplot3d plots#64
DanielBetschinske wants to merge 3 commits into
ErwindeGelder:mainfrom
DanielBetschinske:feature/3dplots

Conversation

@DanielBetschinske

Copy link
Copy Markdown
Contributor

Summary

This PR adds experimental support for exporting Matplotlib mplot3d plots to PGFPlots/TikZ.

Supported so far:

  • 3D line plots
  • 3D scatter plots
  • surface plots
  • wireframe plots
  • contour plots
  • bar3d plots
  • quiver3d plots

I opened this as a draft because it's the first implementation of a relatively large change that touches core export logic. Since the supported 3D plot types share common infrastructure, I am not sure whether splitting this into smaller PRs would be useful. Before marking it as ready for review, I would be happy to get feedback on whether the overall approach looks reasonable or if there are major changes I should make first.

Motivation

The README currently states that 3D plots do not work. This PR closes that gap with a first comprehensive implementation.

Design notes

  • Adds dedicated 3D handling in the export pipeline.
  • Preserves existing 2D behavior where possible.
  • Adds clipping support where required for the new 3D export paths.
  • Adds reference tests for the supported 3D plot types.
  • Uses PGFPlots \addplot3 where possible.

Known limitations / open points

  • Occlusion is not handled by PGFPlots. Some cases may require splitting plots by depth/z-layer in the future.
  • The current implementation focuses on common 3D plot types and tested reference cases; it likely does not cover all edge cases yet.
  • Some 3D Matplotlib artists only expose their data through private attributes, so parts of the implementation depend on Matplotlib implementation details.

@DanielBetschinske
DanielBetschinske force-pushed the feature/3dplots branch 3 times, most recently from e903c1d to ccc9daa Compare May 29, 2026 08:02
@DanielBetschinske
DanielBetschinske force-pushed the feature/3dplots branch 2 times, most recently from 13d93e2 to 5b57448 Compare June 10, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant