Skip to content

Fixed line is drawn wrongly after zoom and pan #3566

@dmulvang

Description

@dmulvang

I experience strange behavior when I zoom and pan in a simple logarithmic scatter plot:
A fixed line, drawn from (0,0) to (100,100), “jumps” to a wrong position after zooming and panning.

Tested on Windows 10, with Plotly 5.0.0, using Python 3.9.

Test code:

import math
import pandas as pd
import plotly.express as px

df = pd.DataFrame([
        [30, 30], 
        [70.0, 70.0]
    ],
    columns=['length', 'width'])

fig = px.scatter(df,
                 x="length",
                 y="width",
                 log_x=True,
                 log_y=True)

fig.update_xaxes(range=[0, math.log10(100*1.1)])
fig.update_yaxes(range=[0, math.log10(100*1.1)])
fig.add_shape(type="line", x0=0.0, y0=0.0, x1=100, y1=100)
fig.show()

PlotlyBug

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