plotly / plotly/plotly.py

Imshow behaviour incorrect with log scale on yaxis

未关闭
#4,284 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

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')

immagine

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')

immagine

Playing around with the yaxis values doesn't seem to affect this behaviour

immagine

Note: It seems to depend only on the closeness of the first and second yaxis values

immagine

VS

immagine

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从使用 px.imshow 和 fig.update_yaxes(type='log', autorange='reversed') 的可复现 Python 示例开始,然后将对数刻度渲染结果与线性刻度结果进行比较。当对于报告的 y 轴值,第一行仍保持可见,同时反向 autorange 和对数缩放仍能正确工作时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。