Skip to content

Imshow behaviour incorrect with log scale on yaxis #4284

Open
@luigibrancati

Description

@luigibrancati

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions