plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

mpl_to_plotly: map enumerated tick labels to Plotly tickvals/ticktext

Open willtryagain opened this issue 4 months ago • 2 comments

Hi, This fixes https://github.com/plotly/plotly.py/issues/5059 preserving axis labels while converting matplotlib plots.

Code PR

  • [x] 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

.

willtryagain avatar Sep 18 '25 12:09 willtryagain

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

gvwilson avatar Sep 23 '25 15:09 gvwilson

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.

willtryagain avatar Oct 06 '25 13:10 willtryagain