Imshow behaviour incorrect with log scale on yaxis
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
Plotly version: 5.15.0
I'm passing some values to the yaxis of px.imshow. If I just plot it as-is it's fine
import plotly.express as px
fig = px.imshow(
img = [[1,2], [3,4], [5,6]],
x = ['A', 'B'],
y = [10, 100, 1000],
text_auto=True,
width=600
)
fig.update_yaxes(autorange='reversed')
But if I change the yaxis type to log using fig.update_yaxis, the first row of data disappears
import plotly.express as px
fig = px.imshow(
img = [[1,2], [3,4], [5,6]],
x = ['A', 'B'],
y = [10, 100, 1000],
text_auto=True,
width=600
)
fig.update_yaxes(type='log', autorange='reversed')
Playing around with the yaxis values doesn't seem to affect this behaviour
Note: It seems to depend only on the closeness of the first and second yaxis values
VS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducible Python example using px.imshow and fig.update_yaxes(type='log', autorange='reversed'), then compare the log-scale rendering with the linear-scale result. Done means the first row remains visible for the reported y-axis values while reversed autorange and log scaling still work correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100