Skip to content

legend and yaxis titles don't match in color #3883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Coding-with-Adam opened this issue Sep 7, 2022 · 1 comment
Open

legend and yaxis titles don't match in color #3883

Coding-with-Adam opened this issue Sep 7, 2022 · 1 comment
Assignees
Labels
bug something broken P3 backlog

Comments

@Coding-with-Adam
Copy link
Contributor

Coding-with-Adam commented Sep 7, 2022

A community member has pointed out via message to Jiny that the yaxis2 and yaxis3 title colors don't match the yaxis2 and yaxis3 legend color in this example.

The community member suggested the following:

the colors follow the ‘Plotly’ color sequence (#636EFA, #EF553B, #00CC96, #AB63FA).
Setting titlefont and tickfont to those values in the order of the axes works.

A similar issue can be found in the first example in the javascript docs; the second example of the javascript docs has a yaxis5 title which does not exist in the legend.

@alexcjohnson
Copy link
Collaborator

Nice catch! In the first one, the issue is that we hard-coded the axis colors to match the default trace colors with no template, but when plotly.py adopted a different default template we needed to update the colors. While we're at it though, rather than setting tickfont.color and textfont.color separately, we should be able to just set color, ie this:

    yaxis=dict(
        title="yaxis title",
        titlefont=dict(
            color="#1f77b4"
        ),
        tickfont=dict(
            color="#1f77b4"
        )
    )

can simplify to:

    yaxis=dict(title="yaxis title", color="#1f77b4")

In the JS docs, looks like someone just simplified this mock: https://rreusser.github.io/plotly-mock-viewer/#20 but didn't properly adjust the titles and colors of y5 and y6 to be correct for y3 and y4. Also that whole page can simplify the colors the same way.

@AaronStiff AaronStiff added the bug something broken label Mar 18, 2023
@gvwilson gvwilson added the P3 backlog label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants