plotly / plotly/plotly.py

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

Open
#4,041 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the public fig.update_layout and fig.update_xaxis entry points, then trace how x-axis and y-axis tick labels are represented. Define the formatter behavior and API, and consider how tests should verify arbitrary formatting without requiring manual tickvals and ticktext.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.