plotly.py
plotly.py copied to clipboard
mpl_to_plotly: map enumerated tick labels to Plotly tickvals/ticktext
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
.
thanks @willtryagain - I'll try to find someone to review this in the next work cycle.
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.