plotly / plotly/plotly.js

[BUG]: Weird behavior x-axis with log scale

Open
#7,569 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Description

I have a scatter plot with 2 series, using layout.xaxis.type = 'log'.
I have two annotations, on which I applied log10 (cf. https://github.com/plotly/plotly.py/issues/2580).
One is properly showing, while the other one seems to misplace annotations and series.

I've noticed the following:

  1. Removing the annotations makes it work
  2. Removing 1 digit for precision for annotations makes it work. More generally, reducing precision makes it work, but I'm unsure if it's a matter of luck or something I can rely on.
Screenshots/Video

Please see codepens below.

Steps to reproduce

Failing example

Working example

Notes

None

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 by running the failing and working CodePen examples and comparing their annotation precision and log-scale x-axis configuration. Trace how plotly.js positions annotations and series on a logarithmic x-axis, focusing on the difference between the two examples. Done means the failing example positions both annotations and series correctly without relying on reduced precision, with the existing working behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.