Skip to content

enable arbitrary formatting on x-axis and y-axis tick labels #4041

Open
@pmantica3

Description

@pmantica3

Thanks for the awesome work on this project! It is incredibly useful!

I have a feature request. I work for a hedge fund and we want our plotly graphs to follow a standardized format. I am having a hard time through writing a generic formatting function that formats the x-axis and y-axis tick values.

For instance, if you wanted to set the tick axis to be bold and include a "x" at the end, you would need to do something like:

fig.update_layout(
    yaxis = dict(
        tickmode = 'array',
        tickvals = [1, 2, 3],
        ticktext = ["<b>1x</b>", "<b>2x</b>", "<b>3x</b>"]
    )
)

Which is pretty inconvenient because you have to specify the tickvals every time you want to do this.

So I was thinking that it could be a good idea to add something like:
fig.update_xaxis(tick_text_formatter=<function that formats a tick value>)

Thoughts?

Again, thanks for the awesome work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions