Skip to content

Conversation

@willtryagain
Copy link

@willtryagainwilltryagain commented Sep 18, 2025

Hi,
This fixes#5059 preserving axis labels while converting matplotlib plots.

Code PR

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the code generator and not the generated files.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code

.

@willtryagainwilltryagain changed the title matplotlib tick labels addmatplotllib: map enumerated tick labels to Plotly tickvals/ticktextSep 18, 2025
@willtryagainwilltryagain changed the title matplotllib: map enumerated tick labels to Plotly tickvals/ticktextmpl_to_plotly: map enumerated tick labels to Plotly tickvals/ticktextSep 18, 2025
@gvwilsongvwilson added P2 considered for next cycle community community contribution fix fixes something broken labels Sep 23, 2025
@gvwilson
Copy link
Contributor

thanks @willtryagain - I'll try to find someone to review this in the next work cycle.

@willtryagain
Copy link
Author

Hi @emilykl ,

This change maps enumerated tick labels to Plotly tickvals/ticktext in mpltools.prep_ticks. I realize it could be viewed as risky if applied too broadly (e.g., forcing array-mode on numeric axes). I only tested locally on a simple script.
Would using a more tighter check and adding tests make it easier to review? Let me know if you have any suggestions.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

communitycommunity contributionfixfixes something brokenP2considered for next cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mpl_to_plotly does not preserve axis labels (bar plots are useless)

3 participants

@willtryagain@gvwilson@emilykl