Export tick label colors to the plotly tickfont - #5716
Open
robertoffmoura wants to merge 1 commit into
Open
robertoffmoura wants to merge 1 commit into
robertoffmoura wants to merge 1 commit into
Conversation
robertoffmoura
force-pushed
the
rm/export-tick-label-color
branch
from
September 3, 2026 11:06
49144f8 to
6a169d3
Compare
camdecoster
requested changes
Sep 28, 2026
camdecoster
left a comment
Contributor
There was a problem hiding this comment.
Transparent colors strike again! Could you please address the comments and add a changelog entry? Thanks for all of your work in this area.
| labels = axis.get_ticklabels() | ||
| if labels: | ||
| props["fontsize"] = labels[0].get_fontsize() | ||
| props["fontcolor"] = export_color(labels[0].get_color()) |
Contributor
There was a problem hiding this comment.
export_color can produce "none" for transparent labels. As is, this could crash the conversion.
| tickfont=dict(size=props["axes"][0]["fontsize"]), | ||
| tickfont=dict( | ||
| size=props["axes"][0]["fontsize"], | ||
| color=props["axes"][0]["fontcolor"], |
Contributor
There was a problem hiding this comment.
You could wrap this (and below) in _export_color to address the "none" color issue.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tick label colors are dropped by the converter. The mplexporter does not export the tick label color, so the plotly tickfont gets a size with no color and tick labels always render in plotly's default dark grey, which is nearly invisible on dark figures (e.g.
plt.style.use("dark_background")).Fix: the mplexporter axis properties now export the tick label color, and prep_xy_axis passes it through to the plotly tickfont.
Snippet to reproduce: